| | |
Computing factorial
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Nov 2009
Posts: 1
Reputation:
Solved Threads: 0
C++ Syntax (Toggle Plain Text)
#include<stdio.h> #include<conio.h> main() { int a,i,fact=1; clrscr(); printf("Enter a number "); scanf("%d",&a); for(i=1;i<=a;i++) { fact=fact*i; } printf("Fact of %d is %d",fact,a); getch(); }
Last edited by ~s.o.s~; Nov 8th, 2009 at 11:02 am. Reason: Added code tags, please learn to use them.
![]() |
Similar Threads
- factorial help (C++)
- News Story: Museum of Computing does a Schwarzenegger (Cellphones, PDAs and Handheld Devices)
- factorial using a for loop (C++)
- How do I check (Assembly)
- Factorial? (C++)
- Estimate value of e (C)
- Calculate the factorial of a number (Visual Basic 4 / 5 / 6)
Other Threads in the C++ Forum
- Previous Thread: fstream not working
- Next Thread: Problem when generate ID from txt file
Views: 51 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int integer java lib library linkedlist linker linux loop looping loops map math matrix memory microsoft newbie news number output parameter pointer problem program programming project python random read recursion recursive reference return sort stream string strings struct studio system template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets





