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;

in c++ you can easily write Factorial of any number, it is the product of an integer and all the integers below it for example factorial of 5 is 5! = 5 * 4 * 3 * 2 * 1 = 120. factorial program in c++ is very simple and easy.

thankzz a lot for this program!!

ReplyDeleteThanx a lot for this program.

ReplyDeletereally thanks for this program.

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

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

this programe is not enough

Deletethaks a lot...

ReplyDeletethank you

ReplyDeletethx bro really helped me :)

ReplyDeletethnks a lott..

ReplyDeletethanks for this code !!!!

ReplyDeletenice one dude!!!!!1

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

ReplyDeletei got idea 2 write program.. thanks...

ReplyDeletethank u very much

ReplyDeletenice one

ReplyDeletethanks you

ReplyDeletethanx dude

ReplyDeleteplz send me ans.

ReplyDeleteprogram to linked list

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

tenk u for ur program....jejeje

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

ReplyDeletehmm

Deleteabid javed....

ReplyDeleteyr program perfect nia hy.......

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

ReplyDeleteThanks for usefull ideas

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

ReplyDeletethank u very much to this program..........

ReplyDeletefactorial using two variables?

ReplyDeletesuperb.......!!!

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

ReplyDeleteGuys 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

ReplyDeleteexample 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

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

DeleteFactorial of big numbers by c program

//factorial of large numbers

Delete#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");

}

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

ReplyDeleteCheck the Code1

Deletethanks

ReplyDeletei 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

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

ReplyDelete#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

ReplyDeleteCan I get the program palindrome using stack

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

ReplyDeleteFacebook page for programming concepts is

ReplyDeleteCodecommunity

thanks

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

ReplyDeleteanswer is not coming right....

thanks

ReplyDeletereally such a nice program and thank you for this tutorial

ReplyDeleteThanks for nice post.C programming details here

ReplyDeletethanks pretty much guys

ReplyDeletethanks guys pretty much

ReplyDeletereally cool thinkin

ReplyDeleteFactorial Program in C++

ReplyDeletein c++ you can easily write Factorial of any number, it is the product of an integer and all the integers below it for example factorial of 5 is

5! = 5 * 4 * 3 * 2 * 1 = 120. factorial program in c++ is very simple and easy.

totally optimized code ! thank you for sharing.

ReplyDelete