C preprocessor Takes care of conditional compilation Takes care of macros Acts before compilation Takes care of include files All of these TRUE ANSWER : ? YOUR ANSWER : ?
Determine output:#include <stdio.h>void main(){ char *p = NULL; char *q = 0; if(p) printf(" p "); else printf("nullp"); if(q) printf("q"); else printf(" nullq");} nullp nullq x nullq where x can be p or nullp depending on the value of NULL p q Depends on the compiler TRUE ANSWER : ? YOUR ANSWER : ?
What will be the value of sum after the following program is executed?void main(){ int sum=1, index = 9; do{ index = index – 1; sum *= 2; }while( index > 9 );} 2 0.5 9 1 0.25 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the final value of the digit?void main(){ int digit = 0; for( ; digit <= 9; ) digit++; digit *= 2; --digit;} 20 -1 16 17 19 TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following is correct way to define the function fun() in the below program?#include<stdio.h>void main(){ int a[3][4]; fun(a);} void fun(int *p[4]){} None of these void fun(int *p[3][4]){} void fun(int *p[][4]){} void fun(int p[][4]){} TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:#include<stdio.h>#define a 10void main(){ #define a 50 printf("%d", a);} None of These Compiler Error 10 50 TRUE ANSWER : ? YOUR ANSWER : ?
short testarray[4][3] = { {1}, {2,3}, {4,5,6}};printf("%d", sizeof(testarray));Assuming a short is two bytes long, what will be printed by the above code? It will not compile because not enough initializers are given 6 7 12 24 TRUE ANSWER : ? YOUR ANSWER : ?
What will be output if you will compile and execute the following c code?#include<stdio.h>#define max 5void main(){ int i = 0; i = max++; printf("%d", i++);} 6 7 5 Compiler Error 0 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following program code?main(){ static int var = 5; printf("%d ", var--); if(var) main();} Compilation Error Infinite Loop 5 4 3 2 1 5 5 5 5 5 None of these TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:void main(){ int i=i++, j=j++, k=k++; printf("%d %d %d", i, j, k);} 0 0 0 Error 1 1 1 garbage values TRUE ANSWER : ? YOUR ANSWER : ?