F&A Diskussionen
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 Stimmen
8 AntwortenNeed help!!!
1 Stimme
1 AntwortHeute heiß
How to make a 2d game
1 Votes
Html
2 Votes
Detach thread exception
1 Votes
Error: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row:
1 Votes
Need a tutor on Java
0 Votes