Обсуждения
Python Else-If
0 голосов
4 ответовElse-If Statements
0 голосов
1 ответAbout else-if statement
0 голосов
1 ответ<h1> syntax in 16.1
1 голос
3 ответов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 голосов
8 ответовПочему не работает?
0 голосов
2 ответовАктуальное сегодня
DSA doubt
1 Votes
Input errors (python)
1 Votes
Data structure using C
0 Votes
Vote Code
1 Votes
Without degree job
0 Votes