-->



Huawei Placement Paper


1. void checkA()
{
int a=2;
if(a=3!=3)
printf(" 3 ");
else
printf(" 2 ");
return;
}

2. main()
{
char P[]={"Hello World"};
printf(" %s
",p);
main();
}

3. UINT i,j;
i = j = 0;
i = ( i++ > ++j ) ? i++ : i--;

4. # define D 10
# define Y D+10
# define D 30
main(int argc, char *arc[])
{
printf(" %d
",D);
}

5. # define TRUE 0
main()
{
int i=0;
while(TRUE)
{
printf(" %d
",i);
i++;
}
printf(" %d
",i);

6. UCHAR j;
for(j=0;j<2000;j++);
Number of iterations?

7. main()
{
int a[5];
a[0]=0;
a[1]=1;
for(i=2 ; i<4 ; i++)
a[i] = a[i-1] + a[i-2];
}
What are the elements of array?