C Language: Decision Control - Online Test

Test Difficulty Level: Medium

Syllabus of Test

Computer Programming: Questions about C related to decision control structures.

Sample Question from this online test:

Question: main( )
{
int i = 5, j = -1, k = 0, y, z ;
y = i + 5 && j + 1 || k + 2 ;
z = i + 5 || j + 1 || k + 2 ;
printf ( "\ny = %d z = %d", y, z ) ;
}

Option A: 1 0

Option B: 0 1

Option C: 1 1

Option D: none

To answer, click the "Start This Test" button below.

Start this Test






Comments

Rajat Jindal on 2011-08-22 02:45:34 wrote,

answer of 20 no qustion is wrong i think it should be error....

karthik ravi on 2011-10-19 03:48:19 wrote,

C language: decision control ==>

mr.vinit, ur questions are good but there are some wrong decisions which u have picked as correct answers.

Q2: This problem will yield the result of 1011 not 1010. Actually this answer is not at all available in the options.

Q11: U r doing operations with i, j, k and l. But u have used capital i (I) to print. obviously it will give error. So here also ur answer is wrong. please check them

Q16: If the answer is A ("Not Definitely"), then what the \n is doing in the printf?

Anyway thanks for questions