google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a C++ program to find the factorial of a given number - 2nd puc computer science

Write a C++ program to find the factorial of a given number

Write a C++ program to find the factorial of a given number

#include<iostream.h>

#include<conio.h>

void main( )

{

int n,fact,i;

clrscr();

cout<<"Enter the number"<<endl;

cin>>n;

fact=1;

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

fact=fact*i;

cout<<n<<"!="<<fact;

getch( );

}


Write a C++ program to find the factorial of a given number Write a C++ program to find the factorial of a given number Reviewed by Vision Academy on February 27, 2022 Rating: 5

No comments:

CheckOut

Powered by Blogger.