Professional Documents
Culture Documents
Topic Title: C++ While Statement Specific Objectives:: Programming Logic and Design
Topic Title: C++ While Statement Specific Objectives:: Programming Logic and Design
TOPIC PRESENTATION:
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
unsigned long num, fact=1;
cout<<"Enter a number: ";
cin>>num;
while(num)
{
fact = fact*num;
num--;
}
cout<<"The factorial of the number
is "<<fact;
getch();
}
When the above program compile and executed,
it will produce the following output:
REFERENCES: