Our Recommendation for You Search your Query, You can find easily. for example search by book name or course name or any other which is related to your education

Followers

how to find the factorial of a number using while loop in c++


how to find a factorial of a number in c++
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();
                 }


OUR SUGESSTION YOU SHOULD VISIT