#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int n,f=1;
cout <<"Enter number for factorial \n";
cin>> n;
for(int i=n;i>=1;i--)
{
cout << f<<"\n\n";
f*=i;
}
getch();
return 0;
}
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int n,f=1;
cout <<"Enter number for factorial \n";
cin>> n;
for(int i=n;i>=1;i--)
{
cout << f<<"\n\n";
f*=i;
}
getch();
return 0;
}
this is my favorit subject and i have full command on this
thanx for contact ---------------
Last edited by *KHAN*JEE*; 6th June 2010 at 01:22 PM. Reason: Cell Number Removed...
thanks
c++ is my favrt subject.
thanx 4 sharing
Great
your thread is very nice, thanks 4 sharing with us!
brother kuch detail b batao na
i m new
Nice Sharing
nice
great job using for statement
i was tryingit with if else statement
Sorry bhai...jis ne iss k compiler likhain hain...woh master nahin hota to aap kaisay khud ko kehtay ho k full command hai aap ko....agar aap ziada jantay hain to try karain k yahan jitna ziada ho sakay sikhanay ki kooshash karain,,,,Allah bless u
aur haan for loop k bahir n ki value ko print karain....iss tarah sirf 1 bar value print ho g
jaisay
Code:#include <iostream> #include <conio.h> using namespace std; int main() { int n,f=1; cout <<"Enter number for factorial \n"; cin>> n; for(int i=n;i>=1;i--) { f*=i; } cout << f<<"\n\n"; // print here getch(); return 0; }
Bookmarks