Print sum of entered 10 numbers
#include<iostream.h>
#include<conio.h>
void main()
{
int i =1, no, sum = 0;
clrscr();
do
{
cout<<"Enter number :";
cin>>no;
sum = sum + no;
i++;
}
while(i <= 10);
cout<<"Sum of 10 numbers is :"<<sum;
}
Print sum of first 10 numbers
#include<iostream.h>
#include<conio.h>
void main()
{
int i =1, sum = 0;
clrscr();
do
{
sum = sum + i;
i++;
}
while(i <= 10);
cout<<"Sum is :"<<sum;
}
#include<iostream.h>
#include<conio.h>
void main()
{
int i =1, no, sum = 0;
clrscr();
do
{
cout<<"Enter number :";
cin>>no;
sum = sum + no;
i++;
}
while(i <= 10);
cout<<"Sum of 10 numbers is :"<<sum;
}
Print sum of first 10 numbers
#include<iostream.h>
#include<conio.h>
void main()
{
int i =1, sum = 0;
clrscr();
do
{
sum = sum + i;
i++;
}
while(i <= 10);
cout<<"Sum is :"<<sum;
}