Searching...

Sum of Integers up to Given point.

15:40

#include <iostream>
using namespace std;
int main()
{
int sum=0,end_num;
cout << "Enter integer for which u want to get Sum: ";
cin >> end_num;
for (int i=1;i<=end_num;i++)
sum=sum+i;
cout << "Integer Sum of 1 to "<< end_num << " is= " << sum <<endl;
return 0;
}

0 comments:

Post a Comment

Thanks For Your FeedBack....

:) :)) ;(( :-) =)) ;( ;-( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ $-) (b) (f) x-) (k) (h) (c) cheer
Click to see the code!
To insert emoticon you must added at least one space before the code.