Sesiones de PyR
why does this code output that there is an error because the else statement doesn't have a corresponding if statement?. How do i correct this?
#include <iostream>
using namespace std;
int main() {
int a;
for (int x =0; x<5;x++){
cin>>a;
if (a<1){
cout<<"a cannot be less than 1\n";
}
else if (a>10){
cout <<"a cannot be greater than 10\n";
}
}
else{
cout<<"code can run now"<<endl;
}
return 0;
}
3 Votos
8 RespuestasJava data types vs. JS
12 Votos
1 RespuestaHow to achive this task
2 Votos
1 RespuestaPlz explain output?
0 Votos
2 RespuestasIndexers Questions
3 Votos
2 RespuestasPlease help in this code
3 Votos
8 RespuestasInteger's digits.
0 Votos
2 RespuestasI NEED explaination
14 Votos
12 RespuestasC# basic concept problem
0 Votos
3 Respuestasc++
1 Voto
3 RespuestasJAVA
0 Votos
2 RespuestasEn tendencia hoy
Someone can help me
2 Votes
What's wrong with this?
2 Votes
HTML community, HELP!!
2 Votes
X velocity
0 Votes
I am a super beginner
0 Votes
Files not linking in C++
0 Votes
Web Dev
0 Votes
How this program executes?
0 Votes