Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урокОбсуждения
Void test(){ int i; }
0 голосов
2 ответовIn the code below the output is 2. This code is used in a challenge and I get an error when I select the answer 2. It accepts as correct the answer 1 which I believe is wrong. If you agree please thumbs up.
If you find any other errors please post them here!
#include <iostream>
using namespace std;
int main()
{
for(int i=1; i>=1; i++) {
if(i<1 || i>1){
cout << i;
break;
}
}
return 0;
}
8 голосов
8 ответов
what have i to do, if i want that the program always writes for example :
0+1
1+2
3+3
6+4
10+5
15+6
...
because now it just writes
1
3
6
10
15
...
and maybe if it works, can i make then
0+1=1
1+2=3
3+3=6
6+4=10
#include <iostream>
using namespace std;
int main(){
int i;
int sum = 0;
for (i = 1; i <= 100; i++){
sum = sum+i;
cout<<sum<<endl;
}
cout<<sum;
return 0;
}
1 голос
5 ответовWhy not working
-4 голосов
4 ответовАктуальное сегодня
Media on HTML
0 Votes
Is Sololearn better or Mimo.org?
2 Votes
How to cast in python
0 Votes
How to show img???
0 Votes
Python
0 Votes
Java project
0 Votes
Jungle capming
0 Votes
JavaScript
0 Votes
Editor HTML
0 Votes