-->



Huawei Placement Paper


1. main(){
char *p="Huawei";
printf("%s
",p);
*p++;
printf(%s
",p);
}

2. main(){
int x=5,y=7,z;
z = x++ + y++;
printf("%d
",z);
z = ++x + ++y;
printf("%d
",z);
}

3. main(){
int *p;
p=(int *)malloc(sizeof(int)*20);
memset(p,0,20) or memset(p,20,0) (i don't remember which one)
then some code, i don't remember
}

4. main(){
int x=4;
printf("%d %d %d",x,x>>2,x<<2);
}

5. write a program to print
1
1 2 1
1 2 3 2 1
1 2 3 4 3 2 1

6. write a program to find the Fibonacci series recursively.

7. write a program to find the reverse fib series starting from N.

8. Given the Nth fib no and find the (N-1)th fib no without calculating from the beginning

9. Find the next term 60,30,20,and some logical questions

10. write an optimized program to find the smallest of 3 numbers.

11. implement stack operations with pointers with appropriate exception checks.

12. Explain any program using semaphores.

13. Find the next term 0,4,18,100,-

14. prime number x as x^3-x^2