Dyskusje 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 głosów
8 odpowiedziJava data types vs. JS
12 głosów
1 OdpowiedźHow to achive this task
2 głosów
1 OdpowiedźPlz explain output?
0 głosów
2 odpowiedziIndexers Questions
3 głosów
2 odpowiedziPlease help in this code
3 głosów
8 odpowiedziInteger's digits.
0 głosów
2 odpowiedziI NEED explaination
14 głosów
12 odpowiedziC# basic concept problem
0 głosów
3 odpowiedzic++
1 Głos
3 odpowiedziJAVA
0 głosów
2 odpowiedziPopularne dzisiaj
What's wrong in my code?
4 Votes
App Development
1 Votes
GUI-Based Python code in Webpage
2 Votes
HTML
1 Votes
Introduction of html
0 Votes
Web Developer Job?
1 Votes
CSS or Tailwind
1 Votes
Russian
0 Votes