Computer Science, asked by siddharthnigam4622, 6 months ago

(c) What will be the output of the following code segment :
int a=7. i:
for (i=2; K=12; i=i+3)
System.out.println(a++):
System.out.println(i):

Answers

Answered by anindyaadhikari13
1

\star\:\:\:\sf\large\underline\blue{Question:-}

  • Write the output of the following code snippet.

\star\:\:\:\sf\large\underline\blue{Solution:-}

The program will give an error, So program will not run since k=12 is an assignment statement but we have to writethe .conditions to terminate the for loop.

Hence, no output will come.

Similar questions