Discussioni Q&A
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 Voti
8 RisposteSQL Challenges BUG
0 Voti
2 RisposteI've been trying to make first example program work for about an hour now and I've re-typed it multiple times but it still gives me the same error
ExampleProgram.java:3: error: cannot find symbol
System.out.printIn("Hello World");
And the arrow is pointing at the period (.) after out. Anyone can help me?
0 Voti
7 RispostePopolare oggi
Ошибка в приложении Sololearn
1 Votes
NEO V2.0
1 Votes
Sololearn course
1 Votes
Best language?
0 Votes
Learn - multiple choice course questions display in one box making it impossible to continue
1 Votes
Sql practice
0 Votes