• Courses
  • Code Compiler
  • Discuss
  • Pricing
  • Teams
Menu

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; }
c++
1 Vote
5 Answers
18th Jul 2016, 12:59 PM
Peter MĂŒller
Peter MĂŒller - avatar
#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()???
c++
0 Votes
1 Answer
24th Sep 2016, 10:52 AM
Amit
Amit - avatar
Wher is mistake?
}#include<<<<"enter<iostream>>>0;aa;a"bb"<<endl;cc"<<endl;cincin>>b;coutcout<<"entercout<<d;d;d=sqrt(a*a+b*b+c*c);endl;intmain(){namespacereturnstd;using
0 Votes
5 Answers
11th Oct 2018, 2:30 PM
Dima Moshko
Dima Moshko - avatar
WY 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.
arraysc++
0 Votes
2 Answers
11th Jul 2016, 11:19 PM
zak
< Previous1...45Next >
Hot today
How can one build an Ai app
5 Votes
How to properly reverse a string in python
3 Votes
Can someone explain how it works (im new)
1 Votes
AI Takeover
2 Votes
Python Developer
0 Votes
Deletion of my Post
0 Votes
Using Python on VScode
0 Votes
Average of Two Numbers
0 Votes
Hearts
0 Votes
Can I take the certificates after finished the lessons?
1 Votes