What will be the correct output of the following program?#include<string.h>void main(){ char str[] = "C EXAMINATION", rev[17]; int i = strlen(str), j=0; for( ; i>=0; rev[j++] = str[i--]) rev[j] = str[j] ; puts(rev);} C NOITANIMAXE No output at all. NOITANIMAXE C Syntax error TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:void main(){ char *p; p="%dn"; p++; p++; printf(p-2, 300);} 300 %d\n Error None of These 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 7 6 12 24 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;} 16 19 20 17 -1 TRUE ANSWER : ? YOUR ANSWER : ?
Determine Output:main(){ char *str1 = "abcd"; char str2[] = "abcd"; printf("%d %d %d", sizeof(str1), sizeof(str2), sizeof("abcd"));} 8 5 5 2 4 5 2 5 5 2 4 4 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 garbage value will print Hello World None of these. Compilation Error 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++);} 0 7 Compiler Error 5 6 TRUE ANSWER : ? YOUR ANSWER : ?
Which of the following correctly accesses the seventh element stored in arr, an array with 100 elements? None of these arr{7} arr[6] arr{6} arr[7] TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following program?void main(){ int a, b, c, d; a = 3; b = 5; c = a, b; d = (a, b); printf("c=%d d=%d", c, d);} c=3 d=3 c=5 d=5 c=3 d=5 c=5 d=3 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of this program on an implementation where int occupies 2 bytes?#include <stdio.h>void main(){ int i = 3; int j; j = sizeof(++i + ++i); printf("i=%d j=%d", i, j);} i=3 j=2 the behavior is undefined i=4 j=2 i=5 j=2 TRUE ANSWER : ? YOUR ANSWER : ?