0
Explain the code
#include<stdio.h> int main() {int i=1,j=1; while(i++<=100) {while(j++<=200) {if(j==150) break; else printf("%d%d\n",i,j);}} return(0);}
2 Answers
+ 15
#include<stdio.h>
int main(){
int i=1,j=1;
while(i++<=100){
while(j++<=200){
//â for i=2, j will print from 2 to 149 & then break;(bcz of j=150)) ... so will come out of inner loop & then after coming to outer loop i becomes 3
//â for i=3 & j prints from 151 to 201
//â now since j=201, inner loop will not work(as 201 is Not <=200) for any value of i, so operation stops.
if(j==150) break;
else printf("%d %d\n",i,j);
//â putten space between i & j to notice output clearly
}
}
return(0);
}
+ 1
Hi cool