Computer Science, asked by AshAshwini, 1 year ago

write a c++ program to find sum for first n whole numbers

Answers

Answered by suyog2
1
#include <stdio. h>
#include<conio. h>
class sum
{
int n,b=0,i;
cout <<"enter no:";
cin>>n;
for (i=0; i <n; i++)
{
b=b+i;
}
cout <<"sum of first "<<n <<" no ="<<b;
}

suyog2: its my pleasure
Similar questions