". VdoTips: C FUNDAMENTAL MCQ 17

APPLY LATEST GOVT JOBS

hi

C FUNDAMENTAL MCQ 17

Q.71 A C program contains the following declaration int i=8, j=5 what would be the value of following expression? abs(i-2*j)
(A) 2
(B) 4
(C) 6
(D) 8


Q.72 What will be the output of the following program main( ) { int k, num=30; k=(num>5 ? (num<= 10 ? 100:200):500); printf(“\n%d”, num); }
(A) 100
(B) 5
(C) 30
(D) 500


Q.73 What is the output of the following code int n = 0, m=1; DC05 PROBLEM SOLVING THROUGH ‘C’ DC-03 COMPUTER FUNDAMENTALS 14 do { printf(“%d”, m); m++; } while(m<=n);
(A) 0
(B) 2
(C) 1
(D) 4


Q.74 If a=8 and b=15 then the statement x= (a>b) ? a:b;
(A) assigns a value 8 to x
(B) gives an error message
(C) assigns a value 15 to x
(D) assigns a value 7 to x


Q.75 What is the output of the following code int n=0, m; for (m=1; m<=n+1; m++) printf(“%d”, m);
(A) 2
(B) 1
(C) 0
(D) 6