C Programming What's wrong in the following statement, provided k is a variable of type int?for(k = 2, k <=12, k++) The increment should always be ++k . The commas should be semicolons. The variable k can’t be initialized. There should be a semicolon at the end of the statement. The variable must always be the letter i when using a for loop. The increment should always be ++k . The commas should be semicolons. The variable k can’t be initialized. There should be a semicolon at the end of the statement. The variable must always be the letter i when using a for loop. ANSWER DOWNLOAD EXAMIANS APP
C Programming Determine output of the following program code.#includevoid main(){ int a, b=7; a = b<4 ? b<<1 : ++b>4 ? 7>>1 : a; printf("%d %d", a, b);} 3 7 7 3 None of these 3 8 8 3 3 7 7 3 None of these 3 8 8 3 ANSWER DOWNLOAD EXAMIANS APP
C Programming 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=1 x=0 x=4 Error x=5 x=1 x=0 x=4 Error ANSWER DOWNLOAD EXAMIANS APP
C Programming What is the output of the following program?#includeint c[10] = {1,2,3,4,5,6,7,8,9,10}; main(){ int a, b=0; for(a=0;a<10;++a) if(c[a]%2 == 1) b+=c[a]; printf("%d", b);} 25 30 24 20 None of these 25 30 24 20 None of these ANSWER DOWNLOAD EXAMIANS APP
C Programming Determine output:#include void main(){ char *p = NULL; char *q = 0; if(p) printf(" p "); else printf("nullp"); if(q) printf("q"); else printf(" nullq");} Depends on the compiler p q nullp nullq x nullq where x can be p or nullp depending on the value of NULL Depends on the compiler p q nullp nullq x nullq where x can be p or nullp depending on the value of NULL ANSWER DOWNLOAD EXAMIANS APP
C Programming Which of the following function is more appropriate for reading in a multi-word string? scanf() printf() None of these puts() gets() scanf() printf() None of these puts() gets() ANSWER DOWNLOAD EXAMIANS APP