Discussions Q&R
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 Vote
5 Réponses#include <iostream>
using namespace std;
class A{
public:
void f1();
};
class B : public A{
public:
virtual void f1();
}
int main()
{
A * obj = new B;
obj.f1();
}
Ques: can we write virtual before an overridden function from the base class?? if yes which f1() should it call base class f1() or derived class f1()???
0 Vote
1 RéponseWher is mistake?
0 Vote
5 RéponsesAujourd'hui en vedette
Pull resistors
3 Votes
AI video creation
3 Votes
Sololearn chat en Español
1 Votes
I'm confuse with this \n
1 Votes
How to make a game code
0 Votes
How to add image and audio
1 Votes
About create tuples [Solved]
0 Votes
Headless CMS
1 Votes
Missing]
0 Votes
HTML
0 Votes