Computer Science

all programs are in C++, C and Php language this blog is all about programming and all about bcs

Tuesday, November 13, 2012

Factorial in C++

# include <conio.h>
# include <iostream.h>
int main()
{
long rt=1;
int fact;
cout <<"Enter the number for factorial: ";
cin >>fact;
for(int i=1;i<=fact;i++)
{
rt=rt*i;
}
cout<<"the Factorial of "<<fact<<" is: "<<rt;
getch();
return 0;
}
at 19:28
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Search Asim Blog

Today Pageviews

11972
euro casino

Pages

  • Home
  • Free Softwares
  • Pakistani Urdu Forum for Free IT Education, ITDunya.com

Blog Archive

  • ▼  2012 (29)
    • ▼  November (16)
      • first program in C++
      • square root in C++
      • square diagram in C++
      • Factorial in C++
      • Log program in C++
      • power function in C++
      • Quadratic equation in C++
      • Table in C++
      • Weather program in C++
      • comparing character and integer in C++
      • Build a diamond in C++
      • Displaying even numbers upto 100 in C++
      • Convert Decimal number to binary numbers in C++
      • conver decimal to Hexadecimal in C++
      • Convert decimal numbers to octal numbers in C++
      • Show which numbers is greater amongst 3 in C++
    • ►  December (13)
  • ►  2013 (11)
    • ►  March (1)
    • ►  April (2)
    • ►  May (8)
  • ►  2014 (7)
    • ►  August (7)
Asim wadood © 2014. Picture Window theme. Theme images by nicodemos. Powered by Blogger.