How to find a factorial of a number in c++:- Here is the source code to find the factorial of a number using while loop in c++.It is quite simple including the body.So try it and give your feed back to me.
#include<iostream.h>
#include<conio.h>
main()
{
int x;
cout<<"enter the value for which you want the factorial:";
cin>>x;
int f=1;
int n=1;
while(n<=x)
{
f=f*n;
n=n+1;
}
cout<<"this is the required value:"<<f<<endl;
getch();
}
End
woow thanx!
ReplyDeletenice program , for more information you can visit http://www.tutorialworld.in/
ReplyDeleteplz explain the working of program step by step for better understanding
ReplyDeleteThis comment has been removed by the author.
ReplyDeletethank you for sharing nice article in your blog
ReplyDeletevisit
web tutorial programming
thank you for sharing nice article in your blog
visit
web tutorial programming
welookups
ReplyDeletenice article for beginners.thank you.
javacodegeeks