What is the output of the program?#include<stdio.h>#include<conio.h>void main(){int i,j=20;clrscr();for(i=1;i<3;i++){printf("%d,",i);continue;printf("%d",j);break;}getch();}A. 1,20B. 1,20,1,20C. 1,2D. 1,2,20,20

C

This question is related to Oracle Interview

Showing Answers 1 - 2 of 2 Answers

amol

  • Jul 26th, 2006
 

ans is

1,2

  Was this answer useful?  Yes

vikas

  • Sep 11th, 2006
 

it ll display "1,2,"... none of the options say that (make a note of comma).. or giving it the benifit of doubt.. c is the answer.

i guess the logic is pretty simple.. after calling the 1st printf(), the current iteration of loop is skipped because of "continue"... so 2nd printf() is never called.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions