to show sum of first 10 numbers in c++
Answers
Answered by
2
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int sum,i;
cout <<"Write 10 numbers to get their sum";
for( i =1 ; i ≤ 10 ; i++)
cin>>i;
cout<<"/n/n Entered numbers are : " <<endl <<i;
sum = 0 ;
sum = sum+i;
cout << "Sum of entered numbers is :- "<<sum;
getch();
}
#include<conio.h>
void main()
{
clrscr();
int sum,i;
cout <<"Write 10 numbers to get their sum";
for( i =1 ; i ≤ 10 ; i++)
cin>>i;
cout<<"/n/n Entered numbers are : " <<endl <<i;
sum = 0 ;
sum = sum+i;
cout << "Sum of entered numbers is :- "<<sum;
getch();
}
Similar questions
Math,
8 months ago
Computer Science,
8 months ago
Physics,
8 months ago
Social Sciences,
1 year ago
Science,
1 year ago
Science,
1 year ago