This is the code wrote so far..

``````#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

//Compute f(n)=n!, for 0<=n<=100
void f(int n){

// Adjust the array a so that each array element contains a single
// digit without altering the number represented by the array a.
// Be sure to maintain m – the number of digits stored in the array a.

short a;
int m = 0;
a[m] = 1;  // 0! = 1; a has m+1 digits
int i, j, k ;

for (k=2;k<=n;k++) {    // compute k!
for (i=0;i<=m;i++)
a[i]*=k;
if(a[i]>=10) m++;
}
for(j=0;j=m;j++)
printf("%d! = %d",n,a[j]);
printf("%d",m);
}
/*
bool palindrome(unsigned n){

char d;

}
*/
void main(){

int i, j;

for(;;){
printf ("Enter your choice ( 1-factorial, 2-palindrome, ^z-exit ) :");
scanf ("%d",&i);
if (i==1){
printf ("Enter an interger >=0 and <=100 :");
scanf("%d",&j);
f(j);

}
/*Part B: Palindrome

else if(i==2){

}*/
else if (i==NULL){
break;
}
else printf("Input 1 or 2. Try again.");

}

getch();
}``````

Can you provide some sample inputs and outputs ?
I am unable to understand what does palindrome and factorials have to do with the problem that you have posted

well let forget about the palindrome.
so for example
input =10
output= 10!=362880
10!=3628800.
what i want to know is how to make
a=3 a=6 a=2 a=8 a=8 a=0 a=0

my friend tell me to use
if(a>=10) a[i+1]++; a=a%10;
but i still haven figure it out yet

my privious code but still have some bug

``````#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

//Compute f(n)=n!, for 0<=n<=100
void f(int n){

// Adjust the array a so that each array element contains a single
// digit without altering the number represented by the array a.
// Be sure to maintain m ¡V the number of digits stored in the array a.

short a;
int m = 0;
a[m] = 1;  // 0! = 1; a has m+1 digits
int i, j, k ;

for (k=2;k<=n;k++) {    // compute k!
for (i=0;i<=m;i++)
a[i]*=k;
while(a[m]>=10){
a[i+1]++; a[i]=a[i]%10;
}
}
for(j=0;j<=m;j++)
printf("%d! = %d \n",n,a[j]);
printf("%d! has %d \n",n,m);
}
/*
bool palindrome(unsigned n){

char d;

}
*/
void main(){

int i, j;

for(;;){
printf ("Enter your choice ( 1-factorial, 2-palindrome, ^z-exit ) :");
scanf ("%d",&i);
if (i==1){
printf ("Enter an interger >=0 and <=100 :");
scanf("%d",&j);
f(j);

}
/*Part B: Palindrome

else if(i==2){

}*/
else if (i==NULL){
break;
}
else printf("Input 1 or 2. Try again.");

}

getch();
}``````

Can you provide some sample inputs and outputs ?
I am unable to understand what does palindrome and factorials have to do with the problem that you have posted

my privious code but still have some bug
it only go up to 7! 8! then something is wrong
i guess that my m doesn't go up..

``````#include <stdio.h>
#include <stdlib.h>
#include <conio.h>

//Compute f(n)=n!, for 0<=n<=100
void f(int n){

// Adjust the array a so that each array element contains a single
// digit without altering the number represented by the array a.
// Be sure to maintain m ¡V the number of digits stored in the array a.

short a;
int m = 0;
a[m] = 1;  // 0! = 1; a has m+1 digits
int i, j, k ;

for (k=2;k<=n;k++) {    // compute k!
for (i=0;i<=m;i++)
a[i]*=k;
while (a[i]>=10){
a[i+1]++; a[i]=a[i]%10;
}
}
for(j=0;j<=m;j++)
printf("%d! = %d \n",n,a[j]);
printf("%d! has %d digits \n",n,m++);
}
/*
bool palindrome(unsigned n){

char d;

}
*/
void main(){

int i, j;

for(;;){
printf ("Enter your choice ( 1-factorial, 2-palindrome, ^z-exit ) :");
scanf ("%d",&i);
if (i==1){
printf ("Enter an interger >=0 and <=100 :");
scanf("%d",&j);
f(j);

}
/*Part B: Palindrome

else if(i==2){

}*/
else if (i==NULL){
break;
}
else printf("Input 1 or 2. Try again.");

}

getch();
}``````
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.