• 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...89Next >
Hot today
Audio adding
1 Votes
playground input
0 Votes
What is problem in this code
0 Votes
Stuck in Quize
1 Votes
This Program Does Something Weird. Can You Explain Why?
1 Votes
C Program
0 Votes
Software developer
0 Votes
Asking for final year project ideas!
1 Votes
How does JavaScript's event loop handle asynchronous operations like setTimeout, Promises, and async/await, and what are the dif
1 Votes
TIPS From Veterans
1 Votes