You are not logged in.

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

husnain
User RankUser RankUser RankUser RankUser RankUser Rank
Administrator
From: Chichawatni,Pakistan
Registered: 2014-10-03
Posts: 8,129
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


You cannot discover the new oceans unless you have the courage to lose the sight of the shore.

2015-09-15 05:54:23

Advertisement
Ads By Google

Re: C Language Control Structures Executed Code:



Board footer