C program to compute the factorial, C/C++ Programming

Write a C program to compute the factorial of  5 i.e 1x2x3x4x5 etc

#include stdio.h
  void main()
  {
  char promt;   
  int factor;
  factor = 1*2*3*4*5;
  printf("The factorial of 5 i.e 5! is %d\n\r",factor);  
  printf("Press any key to exit \n\r");
  scanf("\n%c",&prompt);

  } 

Posted Date: 4/16/2013 1:34:41 AM | Location : United States







Related Discussions:- C program to compute the factorial, Assignment Help, Ask Question on C program to compute the factorial, Get Answer, Expert's Help, C program to compute the factorial Discussions

Write discussion on C program to compute the factorial
Your posts are moderated
Related Questions
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Aim: To implement a program for following string operations: Length of String. String Concatenation. Substring (provide start index and length) Find character a

Write a main program that uses these system calls to echo the typed characters. The pseudo code will look something like: void traphandler ()  {    if (R0 == 0) { // read sys

Question: (a) What is a function? Are functions needed when writing a C program? (b) State one of the advantages to the use of functions. (c) What do you meant by underst


1) Database: The database needs to be used for persistent storage of cars. For details of what information should be stored in the database, please see the description above. You

Can you help me with a C++ project?


Problem Implement a class called employee that contains name, employee number and department code. Include a member function getdata() to get data from user and store it in the

Write a sequence of instructions that transfers data from memory to an external I/O device by using channel 3 of the 8237 DMA controller. Transfer from 20000H-20FFFH.