Posts

Showing posts from April, 2018

Program to find the factorial of any number ?

Image
Factorial: The  factorial  of a non-negative integer n, denoted by n!, is the product of all positive integers less than or equal to n 6 fact=6*5*4*3*2*1          =720                                         #include <iostream> using namespace std; int main() { int iteration,number,i,x=1; char ch; while(x!=0)     {     cout<<"Enter a number to find its factorial:"<<"\n";     cin>>number;         cin.get(ch);         if(cin.fail())         {         cout<<"you enter data is not valid for factorial"<<"\n";         break;     }     else if(ch=='.')         {             cout << "your e...