F&A Diskussionen
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 Stimmen
8 AntwortenExplain please
0 Stimmen
2 AntwortenOutput who can explain?
1 Stimme
1 AntwortAnyone help me with this?
0 Stimmen
2 AntwortenHow do you play Code Coach?
1 Stimme
5 Antwortenwhat 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 Stimme
7 AntwortenHow can I write cool?
2 Stimmen
4 AntwortenCode:Blocks New project how
0 Stimmen
0 AntwortenHow to output Cyrillic?
2 Stimmen
1 AntwortA very strange and rare issue
2 Stimmen
3 Antwortenhelp
-2 Stimmen
5 AntwortenWhy Doing so much stuff?
0 Stimmen
2 AntwortenWhat is wrong with this c++ code?
0 Stimmen
3 AntwortenWhat does the 'cout' operator do?
2 Stimmen
2 AntwortenDoesn't output a thing (C++)
1 Stimme
2 AntwortenHey There ! help me in C++
0 Stimmen
1 AntwortHow I do that program in python
-1 Stimme
1 AntwortWY I get a rundum number from memory when I run this code
#include <iostream>
using namespace std;
int main ()
{
int array [5];
for (int x = 0; x < 5; x++) {
array [x] = 42;
cout << x << ': ' << array [x] << endl;
}
return 0;
}
if I replace ': ' with ": " every thing works well.
0 Stimmen
2 AntwortenWher is mistake?
0 Stimmen
5 AntwortenHeader file of C++
0 Stimmen
1 AntwortHeute heiß
why the link is not playing😿
3 Votes
super laggy
7 Votes
I fell like learning html
0 Votes
About C# .Net
1 Votes
Question related backend
1 Votes
Can someone fix my code?
2 Votes
sizeof pointer and int
0 Votes
I cant find Kotlin
1 Votes