How to print 1 3 6 10 15 21 in c++ By Sir Munavar Ahmad How to print 1 3 6 10 15 21 in c++ By Sir Munavar Ahmad #include<iostream> using namespace std; int main() { int i,inc; inc=2; for(i=1;i<=21;i=i+inc++) { cout<<i<<" "; } return 0; }
0 comments:
Post a Comment
If You Have Any Problem While Downloading Comment Below