#include<stdio.h>
void main()
{
long int number;
int temp;
int i;
printf("Enter a five-digit number: ");
scanf("%ld",&number);
printf("Code A: ");
for(i=10000;i>10;i/=10){
temp=number/i;
number=number%i;
printf("%d",temp);
}
printf("\nCode B: ");
for(i=10;i>=1;i/=10){
temp=number/i;
number=number%i;
printf("%d",temp);
}
getchar();
getchar();
}
Comments
Leave a comment