0% found this document useful (0 votes)
30 views2 pages

Program 1

This C++ program finds the factorial of a user-input number. The user enters a number, then the program uses a for loop to multiply all integers from 1 to the input number, storing the running product in a variable f. Finally, it displays the factorial of the input number on the screen.

Uploaded by

harry221992
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views2 pages

Program 1

This C++ program finds the factorial of a user-input number. The user enters a number, then the program uses a for loop to multiply all integers from 1 to the input number, storing the running product in a variable f. Finally, it displays the factorial of the input number on the screen.

Uploaded by

harry221992
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

PROGRAM-1

TASK-WAP to find factorial of number.

PURPOSE –By implementing this program we are capable to find factorial of


any number.

#include<iostream.h>

#include<conio.h>

int main ()

Int i, n, f=1;

cout<<"enter no.”

cin>>n;

for (i=1;i<=n; i++)

f=f*i;

cout<<f;

getch ();

}
OUTPUT-

You might also like