Friday, 11 December 2015

write a program which multiply numbers from 1 - 10 using loop in c++

#include<iostream>
#include<conio.h>
using namespace std;
int main()
{int n,sum;

sum=1;
n=1;
while(n<=10)
{ sum=sum*n;
n++;
} cout<<"product is = "<<sum;
getch();}

No comments:

Post a Comment