A program to print the sum of the next 10 multiples of a number entered by the user.

 

#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
double sum=0,product,a,b=1;

cout<<"The value of the number is:";
cin>>a;

do
{
product=a*b;
sum=sum+product;
b++;
}
while(b<=10);

cout<<sum;

getch();
}

 

 

< Back