You are not logged in.

#1 2015-09-15 05:54:26

hasnain
Administrator
From: Chichawatni
Registered: 2014-10-13
Posts: 8,355
Website

C Language Control Structures Executed Code:

C Programming Quizzes C Language Control Structures

Directions:
What will be printed if the following code is executed?

Question:
void main()
{
   int x=0;
   for( ; ; )
   {
      if( x++ == 4 ) break;
      continue;
   }
   printf("x=%d", x);
}

Option A):
x=0
Option B):
x=1
Option C):
x=5
Option D):
x=4

Correct Answer is Option C):
x=5


Failure is the first step towards seccess.

2015-09-15 05:54:26

Advertisement
Ads By Google

Re: C Language Control Structures Executed Code:



\n

Board footer