Обсуждения
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 ответовOutput who can explain?
1 голос
1 ответExplain please
0 голосов
2 ответовAnyone help me with this?
0 голосов
2 ответовHow do you play Code Coach?
1 голос
5 ответовHow can I write cool?
2 голосов
4 ответовwhat is tjis code problem!
#include <iostream>
using namespace std;
int main()
{
int b = 5;
int arr[b] = {11, 35, 62, 555, 989};
int sum = 0;
for (int x = 0; x < 5; x++) {
sum += arr[x];
}
cout << sum << endl;
return 0;
}
I cannot make an array using int variable in order to define array's element number!?
1 голос
7 ответовCode:Blocks New project how
0 голосов
1 ответHow to output Cyrillic?
2 голосов
1 ответA very strange and rare issue
2 голосов
3 ответовWhy Doing so much stuff?
0 голосов
2 ответовWhat is wrong with this c++ code?
0 голосов
3 ответовWhat does the 'cout' operator do?
2 голосов
2 ответовHey There ! help me in C++
0 голосов
1 ответHow I do that program in python
-1 голос
1 ответWher is mistake?
0 голосов
5 ответовHeader file of C++
0 голосов
1 ответАктуальное сегодня
What is a web browser intension?
1 Votes
Mentors
1 Votes
Percobaan
0 Votes
Thread local : global vs local
0 Votes
Postgrrsql and python
0 Votes
python
0 Votes
Codding lern
0 Votes
Data Analysis Course
1 Votes
Is there LUA?
0 Votes