Determine Output:void main(){ int i=-1, j=-1, k=0, l=2, m; m = i++ && j++ && k++ || l++; printf("%d %d %d %d %d", i, j, k, l, m);} 0 0 1 2 0 0 0 1 3 0 0 0 1 3 1 0 0 0 2 1 TRUE ANSWER : ? YOUR ANSWER : ?
What will be printed if the following code is executed?void main(){ int x=0; for( ; ; ) { if( x++ == 4 ) break; continue; } printf("x=%d", x);} x=5 x=0 x=4 Error x=1 TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following function calculates the square of 'x' in C? pow(2, x) sqr(x) power(x, 2) power(2, x) pow(x, 2) TRUE ANSWER : ? YOUR ANSWER : ?
Determine output:main(){ int i = abc(10); printf("%d", --i);}int abc(int i){ return(i++);} 11 None of these. 9 10 TRUE ANSWER : ? YOUR ANSWER : ?
What is the result of compiling and running this code?main(){ char string[] = "Hello World"; display(string);}void display(char *string){ printf("%s", string);} will print Hello World None of these. will print garbage value Compilation Error TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:void main(){ char *p; printf("%d %d", sizeof(*p), sizeof(p));} 2 2 2 1 1 1 1 2 TRUE ANSWER : ? YOUR ANSWER : ?
Consider the following program fragment, and choose the correct onevoid main(){ int a, b = 2, c; a = 2 * (b++); c = 2 * (++b);} a = 3, c = 8 a = 4, c = 6 a = 4, c = 8 b = 3, c = 6 b = 4, c = 6 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following program? #include\<stdio.h> int main(){ extern int i; i = 20; printf("%ld ", sizeof(i)); return 0; } Linker Error : Undefined symbol 'i' 2 4 Depends on the Compiler TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following code fragment?void main(){ printf("%x",-1<<4);} fff1 fff2 fff0 fff3 fff4 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");} p q nullp nullq x nullq where x can be p or nullp depending on the value of NULL Depends on the compiler TRUE ANSWER : ? YOUR ANSWER : ?