#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#define SIZE 100
char *tens(int n);
char *hundred(int n);
int main(){
char *p,*ptr,*temp;
long n;
int a,flag=0,c=0;
char t[][10]={"Thousand","Million","Billion","Trillion"};
p
=(char *) malloc(SIZE
* sizeof(char)); temp
=(char *) malloc(SIZE
* sizeof(char)); printf("\nEnter a number : "); if(n<1000){
ptr=hundred(n);
} else {
a=n%1000;
ptr=hundred(a);
n=n/1000;
while (n>0){
a=(n>999)? n%1000 : n;
ptr=hundred(a);
p
=(char *) malloc(SIZE
* sizeof(char)); temp
=(char *) malloc(SIZE
* sizeof(char)); n=n/1000;
}
}
}
char *tens(int n){
int a;
char *p,temp[20];
char t1[][10]={"Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten",
"Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"};
char t2[][10]={"Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"};
if(n<20){
} else {
a=n/10-2;
if((a=n%10)!=0) {
}
}
return(p);
}
char *hundred(int n){
int a;
char temp[40],*p;
char t[][10]={"Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine"};
if(n>99 && n<1000){
a=n/100;
a=n%100;
p=tens(a);
} else {
p=tens(n);
}
return(p);
}