ExamVeda
Login
Home
This question belongs to C Program Control Structures
Control Structures
?

Consider the following code:
void main()
{
   int a[5] = {6,8,3,9,0}, i=0;
   if(i != 0)
   {
      break;
      printf("%d", a[i]);
   }
   else
      printf("%d", a[i++]);
}

What is the output of the above program?

Answer & Solution
Correct Answer: Option D

break can't be used with selection control structures, but can used with repetitive(for, while), or select control structure(switch).

Examveda
Question posted by Examveda
Community

Join the Discussion

2 Comments
Examveda
Examveda 11 years ago
break statement only used within loop or switch to control the cursor.
Ishwar Kumar
Ishwar Kumar 11 years ago
Doubt in answer of this question . What's differnce between selection control and select control structure