Assignments » Flow Of Control » Set 2 » Solution 03
Source Code:
#include<iostream> using namespace std; int main() { int n,fact=1; cout<<"Enter any number : "; cin>>n; while(n>=1) { fact*=n; n--; } cout<<"Factorial :"<<fact; return 0; }
#include<iostream> using namespace std; int main() { int n,fact=1; cout<<"Enter any number : "; cin>>n; while(n>=1) { fact*=n; n--; } cout<<"Factorial :"<<fact; return 0; }
The Output Is:
Enter any number : 7
Factorial : 5040
Course Outline BSIT 2 year Program First Semester Outline Second Semester Outline Third Semester Outline ...
Post a Comment