You are on page 1of 1

1. What is the output of #include <stdio.

h> int main() { int x = 10, y = 20, z = 5, i; i = x < y < z; printf("%d\n", i); return 0; } 2. What is the output of #include <stdio.h> int main() { extern int a; printf("%d\n", a); return 0; } int a=20; 3. How many times is "Hello world" is printed in following program. #include <stdio.h> main() { unsigned int i = 5; while (--i >= 0) printf("Hello World\n"); } 4. What is the size of the following structure on a 32 bit machine? struct S {int ctrl1; char flag; char flag2; int ctrl2; int ctrl3;}; 5. Write a program to echo the arguments in reverse order 6. What do the following definitions mean? int (*i[ ])(); int *(*i)(); 7. What will happen with the following code void blnk_str(char s[]){int i; for(i=0; i<=strlen(s);i++) s[i]= ;} 8. What is the output of following program? #define SQUARE(x) (x * x) main() { int x = 10; int y = 5; printf("%d\n", SQUARE(x+y));} 9. What does the following statement do? Work out for x = 0x01015959 (((x & 0xaaaaaaaa) >> 1) | ((x & 0x55555555) << 1)) 10. What does this program do? What is the returned value for x = 25? int abc (int x) { return(x & 0xFFFFFFFC);} 11. Write a program to convert a decimal string to its integer value without using any library functions 12. Find out if your processor is little-endian or big-endian via a program 13. Implement the character, word, line counting program.

You might also like