answersLogoWhite

0


Best Answer

using c program write factorial number with do..while statement

User Avatar

Wiki User

2009-03-11 02:49:18
This answer is:
User Avatar
Study guides
📓
See all Study Guides
✍️
Create a Study Guide
4.25
12 Reviews

Add your answer:

Earn +20 pts
Q: Using do while statement write cprogram for factorial number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

How do you find the factorial using while loop in c plus plus?

unsigned __int64 factorial(unsigned __int64 number) { unsigned __int64 factorial=1; while(number) factorial*=number--; return(factorial); }


Programming to calculate a factorial number?

By the definition of a factorial, multiply all numbers up to the number given. For example (using Java code): int number = 5; // Sample value long factorial = 1; for (int i = 1; i <= number; i++) { factorial *= i; } System.out.println(number + "! = " + factorial);


How do you write flowchart to find factorial of given number using recursive and non recursive?

1. flochart of cp Program to find factorial of number using function


Write a function to calculate the factorial value of any integer entered through the keyboard?

#include <iostream> using namespace std; int main() { int i, number=0, factorial=1; // User input must be an integer number between 1 and 10 while(number<1 number>10) { cout << "Enter integer number (1-10) = "; cin >> number; } // Calculate the factorial with a FOR loop for(i=1; i<=number; i++) { factorial = factorial*i; } // Output result cout << "Factorial = " << factorial << endl;


C program to find factorial of a given number using pointers?

factorial of a given number using pointers. #include<stdio.h> #include<conio.h> main() { int n, factorial; printf("\nEnter a number"); scanf("%d", &n); factcompute(n, &factorial); printf("\nThe factorial of %d is %d", n, factorial); } factcompute(a, b) int a, *b; { int m; *b = 1; for (m = 1; m <= a; m++) *b = *b * m; getch(); }

Related questions

How do you find the factorial using while loop in c plus plus?

unsigned __int64 factorial(unsigned __int64 number) { unsigned __int64 factorial=1; while(number) factorial*=number--; return(factorial); }


Programming to calculate a factorial number?

By the definition of a factorial, multiply all numbers up to the number given. For example (using Java code): int number = 5; // Sample value long factorial = 1; for (int i = 1; i <= number; i++) { factorial *= i; } System.out.println(number + "! = " + factorial);


How do you write flowchart to find factorial of given number using recursive and non recursive?

1. flochart of cp Program to find factorial of number using function


Write a function to calculate the factorial value of any integer entered through the keyboard?

#include <iostream> using namespace std; int main() { int i, number=0, factorial=1; // User input must be an integer number between 1 and 10 while(number<1 number>10) { cout << "Enter integer number (1-10) = "; cin >> number; } // Calculate the factorial with a FOR loop for(i=1; i<=number; i++) { factorial = factorial*i; } // Output result cout << "Factorial = " << factorial << endl;


C program to find factorial of a given number using pointers?

factorial of a given number using pointers. #include<stdio.h> #include<conio.h> main() { int n, factorial; printf("\nEnter a number"); scanf("%d", &n); factcompute(n, &factorial); printf("\nThe factorial of %d is %d", n, factorial); } factcompute(a, b) int a, *b; { int m; *b = 1; for (m = 1; m <= a; m++) *b = *b * m; getch(); }


Program for finding the factorial of the two given number using constructor?

kjhk


Write a program that the user will enter a number and display the factorial number and it's answer?

#include <iostream> #include <cctype> using std::cin; using std::cout; using std::endl; using std::tolower; long factorial(const int& N); int main() { int N = 0; //factorial of N char command = 'n'; do { cout << "Enter a number to calculate factorial: "; cin >> N; cout << endl << "Factorial of " << N << " is: " << factorial(N) << endl; cout << "Do you want to continue (y/n)?"; cin >> command; cout << endl; } while ('y' 0) { return 1; } else { return (N * factorial(N - 1)); } }


Write a program to find the factorial value of the given number using for loop?

In Java (not tested): long factorial(int number) { long result = 1; for (int i = 1; i


By using call by reference find the factorial of a number?

chutia mc,bc bhosdika


How do you write a C program to find factorial of given integer with out using non-recursive function?

//Factorial using recursive function #include <stdio.h> //To increase the limit, the return type should be changed to unsigned long int fact(int number) { if (number == 0) return 1; return fact(number-1) * number; } int main(void) { int number ; printf("Enter the number to find the factorial:"); scanf("%d",&number); printf("The factorial is:%d",fact(number)); return 0; }


Write a shell program to find factorial using loop?

echo factorial of a number echo Enter the number read n i=1 fact=1 while test $i -le $n do fact=`expr $fact \* $i` i=`expr $i + 1` done echo The factorial of a number is $fact


How can you get the number 25 by using only number 4?

(4 times 4 factorial + 4) divided by 4 4 factorial + the square root of 4 minus (4 divided by 4)

People also asked