C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf

Guys can uplz post a prog for finding factorial for numbers above 10 as the range of 11! exceeds int and so here is the logic but i am not able to code it example 5!=120 A[0]=0,A[1]=2,A[2]=1 6!=720=6*5! 6*A[0]=0;6*A[1]=12;6*A[2]=6; now removing the 1 from A[1]=12 i.e A[1]=2;and adding it to A[2]i.e A[2]=7 and then reversing the array i.e A[0]=7,A[1]=2,A[2]=0 and displaying it i.e 6!=720 similarly for 7!=5040 u can try but using this logic plz code the program

//factorial of large numbers #include #include void calculate(int*,int); void print(int*,int); #define max 10000 //int max =100000000000; int main() { int i,j,a[max],n; printf("enter the no to find factorial\n\n"); scanf("%d",&n); a[0]=1; for(i=1;i<=max;i++) a[i]=0;

## 55 comments:

thankzz a lot for this program!!

Thanx a lot for this program.

really thanks for this program.

this is very helpfull for me to learn how to write programs without any teacher's help.

thanks alot...........

thaks a lot...

thank you

thx bro really helped me :)

thnks a lott..

thanks for this code !!!!

nice one dude!!!!!1

I got an idea 2 write a program myself by seeing this page

i got idea 2 write program.. thanks...

thank u very much

nice one

thanks you

thanx dude

plz send me ans.

program to linked list

single linked list and double linked list with insert, delete items.

tenk u for ur program....jejeje

Thak you for publishing c programs,all are very useful.......

abid javed....

yr program perfect nia hy.......

Thank you so much for the programs, it was really helpful, :)

Thanks for usefull ideas

Thank u very much..I am practising my own programs

thank u very much to this program..........

factorial using two variables?

superb.......!!!

Thank you guys that's really helpful for me! You saved me!!:)

Guys can uplz post a prog for finding factorial for numbers above 10 as the range of 11! exceeds int and so here is the logic but i am not able to code it

example 5!=120

A[0]=0,A[1]=2,A[2]=1

6!=720=6*5!

6*A[0]=0;6*A[1]=12;6*A[2]=6;

now removing the 1 from A[1]=12 i.e A[1]=2;and adding it to A[2]i.e A[2]=7 and then reversing the array

i.e A[0]=7,A[1]=2,A[2]=0 and displaying it i.e 6!=720 similarly for 7!=5040 u can try but using this logic plz code the program

can u provide program of factorial with arguments nd no return value

To find the factorial of very large number like 1000 go through following link:

Factorial of big numbers by c program

Check the Code1

thanks

i need ur helps how can i write a program in c++ to take input from user and it must show it as asterisk using for or while loop.plz

The recursive solution of the above problem(ques 1).

#include

main()

{

int num;

scanf("%d\n",&num);

printf("%d",fact(num));

}

int fact(int num)

{

if(num == 1)

return 1;

return fact(num-1)*num;

}

can I get the "stack" program in c now plzzzzzzz

Can I get the program palindrome using stack

have u any gw basic program and some short information about it

Facebook page for programming concepts is

Codecommunity

//factorial of large numbers

#include

#include

void calculate(int*,int);

void print(int*,int);

#define max 10000

//int max =100000000000;

int main()

{ int i,j,a[max],n;

printf("enter the no to find factorial\n\n");

scanf("%d",&n);

a[0]=1;

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

a[i]=0;

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

{for(j=0;j=10)

{rev=a[k]%10;

p=a[k]/10;

a[k+1]+=p;

a[k]=rev;

}

//print(a,i);

}

void print(int *a,int i)

{

// printf(" ipp is %d",i);

int l,c=0;

printf("factorial of %d is\n\n",i);

for(l=max-1;l>=0;l--)

{ if((a[l]==0)&&(c==0))

continue;

printf("%d",a[l]);

c=1;

}

printf("\n\n");

}

thanks

how to print factorial of a number when user enters 52 input will be between 1 and 100

answer is not coming right....

thanks

hmm

this programe is not enough

thanks pretty much guys

thanks guys pretty much

really cool thinkin

Write a Program to add and subtract two array matrices.please

Factorial of a number

Write a program to find the factorial of a number using functions.

Function Specification:

int factorial(int n)

The function accepts a int and returns an int.

Input Format:

Input consists of 1 integer.

Output Format:

Output consists of a single integer. Refer sample output for formatting details.

Sample Input:

3

Sample Output:

6

can u help me for this

its nice code.

http://www.techcrashcourse.com/2014/10/c-program-find-factorial-of-number.html

i need ur helps how can i write a program in c++ to take input from user and it must show it as asterisk using for or while loop.plz

can you write a reverse program of factorial like 120=5! and 720=6!

can you write a reverse program of factorial like 120=5! and 720=6!

nice program for beginner , we can also find factorial of any number by using for loop

http://scanfcode.com/c-program-find-factorial-number/

Your Factorial Program is wrong because the factorial of 1 is 1 but it shows factorial of 1 is 2.please correct it

Post a Comment