0
CAN someone tell me what's wrong with this code and what's the output?!?
#include <stdio.h> main() { int x; for (x=5;x<=10;x++) { printf ("%d",x); if (x==6); break; } }
7 Respostas
+ 3
#include <stdio.h>
int main() {
int x;
for (x=5;x<=10;x++)
{
printf ("%d",x);
if (x==6)
break;
}
return 0;
}run this
+ 5
#include <stdio.h>
int main() {
//CAN someone tell me what's wrong with this code and what's the output?!?
//#include <studi.h>
//main(){
int x;
for (x=5;x<=10;x++){ //for
printf ("%d",x);
if (x==6);
break;
} // for ends
return 0;
}
edit :Siyam run this in code- playground and compare with your code snippet
+ 3
Actually there is an ";" just after if statement. So the loop breaks on its first iteration
+ 2
Spelling of <stdio.h> is wrong
here👇
https://code.sololearn.com/cbjQzzeYEM8K/?ref=app
+ 2
Now check it should work now
+ 1
Still got no output ,showing errors
+ 1
Yah got it