C++ is a middle-level programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs. C++ runs on a variety of platforms, such as Windows, Mac OS, and the various versions of UNIX.
Wednesday, 6 April 2016
write a program in c++ to find product of n natural no's using do while loop.
//wap in c++ to find product of n natural no's using do while loop.
Coding:-
#include<iostream.h> #include<conio.h> void main() { int i=1,n,prod=1; cout<<"enter the no"; cin>>n; do{ prod=prod*i; i++; } while(i<=n); cout<<"product="<<prod; getch(); }
No comments:
Post a Comment