WAP in c++ to display sum of numbers between 1 and the number entered
Answers
Answered by
1
Explanation:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
cout<<"enter the number"<<;
int n;
cin>>n>>;
int sum=0
for (int i=1;i<=n;i++)
{
sum=sum+i;
}
cout<<"the sum is"<<sum<<;
getch()
}
Similar questions
Math,
5 months ago
Hindi,
5 months ago
Social Sciences,
1 year ago
Computer Science,
1 year ago
Physics,
1 year ago
English,
1 year ago