Q&A Discussions
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 Answers#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 Votes
 1 AnswerWher is mistake?
 0 Votes
 5 AnswersHot today
Please recommend me
 0 Votes
Can i code here? Or just learn?
 0 Votes
It's app not running properly?
 1 Votes
Why Lazy?
 1 Votes
Learn tkinter 
 1 Votes
Patterns in Functional Paradigm
 1 Votes


