0% found this document useful (0 votes)
11 views2 pages

C Programming Language to Solve Problems

Uploaded by

aowladhussain99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

C Programming Language to Solve Problems

Uploaded by

aowladhussain99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

/*

A program that reads an integer n and computes n!!!!


*/
#include <stdio.h>
int main(){
long long unsigned int n, i, j;
long long unsigned int f;

scanf("%llu", &n);

for(j=1;j<=4;j++){
f = 1;
for(i=1; i <= n; i++)
{
f *= i;
}
n = f;
}

printf("%llu", f);

return 0;
}

/*
A program to read n from user and then print the factorial of n:
f = 1*2*3*...*n
*/
#include <stdio.h>

int main()
{
int a, n, f = 1;

printf("Enter n:\n");
scanf("%d", &n);
for (a = 1; a <= n; a++)
{
f = f * a;
}

printf("Factorial : %d\n", f);

return 0; }

You might also like