Computer Science, asked by monalisaganguly1982, 1 year ago

WAP in c++ to display sum of numbers between 1 and the number entered

Answers

Answered by Anonymous
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