Q&A Discussions
3d game problem
0 Votes
2 AnswersFind the bug...
3 Votes
1 AnswerJOptionPane
-3 Votes
1 AnswerShow command doesn't wirk
0 Votes
1 Answerwhy 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 Votes
8 AnswersHow to use cerr in c++ ?
2 Votes
2 AnswersHot today
Why this code still works
1 Votes
Python
1 Votes
Why won't canvas work?
2 Votes
++ Confusion in java
0 Votes
Pancakes, error or am I stupid?
1 Votes
Java microproject
0 Votes