#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;
}
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....