answersLogoWhite

0

#include<stdio.h>

#include<conio.h>

void main()

{

int i,n,fact=1;

clrscr();

printf("enter the number");

scanf("%d",&n);

for(i=1;i<=n;i++)

printf("%d",n);

fact=fact*i;

{

printf("the factorial is=%d",fact);

}

getch();

}

By:-Abhishek Goyal(goyal.abhi40@Yahoo.com)

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

7 Write a C program to compute the factorial of a number using for loop?

int factorial(int n) { int i; int f=1; for(i=2;i&lt;=n;++i) f*=i; return f; }


Write a C program to find out factorial if 10?

Here's a simple C program to calculate the factorial of 10: #include &lt;stdio.h&gt; int main() { int i; unsigned long long factorial = 1; // Use unsigned long long for larger results for(i = 1; i &lt;= 10; i++) { factorial *= i; } printf(&quot;Factorial of 10 is %llu\n&quot;, factorial); return 0; } This program uses a loop to multiply numbers from 1 to 10 and stores the result in factorial, which is then printed.


Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


How do you write a c program to design calculator using loop?

Wr


output of a c program using function to find factorial of a number?

In a C program that calculates the factorial of a number using a function, the program typically prompts the user for an integer input. The function then recursively or iteratively computes the factorial by multiplying the number by the factorial of the number minus one until it reaches one. For example, if the user inputs 5, the program outputs 120, as 5! = 5 × 4 × 3 × 2 × 1. The final result is displayed on the screen.


Write a C-like program fragment that calculate the factorial function for argment 12 with do while loop?

#!/usr/bin/perl print factorial($ARGV[11]); sub factorial { my($num) = @_; if($num == 1) { return 1; # stop at 1, factorial doesn't multiply times zero } else { return $num * factorial($num - 1); # call factorial function recursively } }


C program algorithm for simple interest using while loop?

Not used


Sum three real numbers using for loop in c program?

take input n chodo


Write 8085 assembly language program for BCD up counter and display using 8279?

loop: mvi c,59 dcr c mov a,c daa movc,a jnz loop end


How do you find factorial 5 in C programming?

to find the factorial we declare a variable n and initialize its value to 1 initiate a loop for example a for loop and multiply the numbers upto 5 code:- for(i=1,n=1;i&lt;=5;i++) { n=n*i; }


What is odd loop in 'C' program?

odd loop means at least the loop execute once.


How do you write a C plus plus program that displays a pyramid of Xes on the screen using a for loop?

printf ("x")