New course! Every coder should learn Generative AI!
Try a free lessonQ&A Discussions
Python Else-If
0 Votes
4 AnswersElse-If Statements
0 Votes
1 AnswerAbout else-if statement
0 Votes
1 Answer<h1> syntax in 16.1
1 Vote
3 Answerswhy 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 AnswersПочему не работает?
0 Votes
2 AnswersHot today
Python Question
4 Votes
Initials of name
1 Votes
post your python code here)
2 Votes
Python Core - restarting?
1 Votes
Css In python
0 Votes
Forever loop pls help
0 Votes