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 = 8 a = 4, c = 6 b = 3, c = 6 b = 4, c = 6 TRUE ANSWER : ? YOUR ANSWER : ?
The statement int **a; is legal but meaningless is syntactically and semantically correct is illegal None of these. TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the given program?#include<stdio.h>void main(){int a=11,b=5;if(a=5) b++;printf("%d %d", ++a, b++);} 11 6 6 6 12 7 5 6 6 7 TRUE ANSWER : ? YOUR ANSWER : ?
What is the correct value to return to the operating system upon the successful completion of a program? Program do no return a value. 1 -1 2 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the program ?#include<stdio.h>void main(){ int a[5] = {5, 1, 15, 20, 25}; int i, j, m; i = ++a[1]; j = a[1]++; m = a[i++]; printf("%d, %d, %d", i, j, m);} 1, 2, 5 3, 2, 15 2, 1, 15 2, 3, 20 TRUE ANSWER : ? YOUR ANSWER : ?
What is the output of the following program?#include<stdio.h>int 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 24 None of these 30 20 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the following program?void main(){ char str1[] = "abcd"; char str2[] = "abcd"; if(str1==str2) printf("Equal"); else printf("Unequal");} Error Unequal Equal None of these. TRUE ANSWER : ? YOUR ANSWER : ?
Consider the following program fragment:for(c=1, sum=0; c <= 10; c++){ scanf("%d", &x); if( x < 0 ) continue; sum += x;}What would be the value of sum for the input 1, -1, 2, -2, 3, -3, 4, -4, 5, -5 15 30 -5 1 10 TRUE ANSWER : ? YOUR ANSWER : ?
What will be the output of the program if the array begins at address 65486?#includevoid main(){ int arr[] = {12, 14, 15, 23, 45}; printf("%u, %u", arr, &arr);} 65486, 65488 None of these 65486, 65490 65486, 65487 65486, 65486 TRUE ANSWER : ? YOUR ANSWER : ?
What is right way to Initialize array? int n(6) = { 2, 4, 12, 5, 45, 5 }; int num[6] = { 2, 4, 12, 5, 45, 5 }; int n{6} = { 2, 4, 12 }; int n{} = { 2, 4, 12, 5, 45, 5 }; TRUE ANSWER : ? YOUR ANSWER : ?