0% found this document useful (0 votes)
6 views2 pages

New Plain Text

Uploaded by

ritewa1608
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

New Plain Text

Uploaded by

ritewa1608
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

/******************************************************************************

Welcome to GDB Online.


GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,

C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>

void convertNumberToText(int number) {


switch (number) {
case 0:
printf("Zero\n");
break;
case 1:
printf("One\n");
break;
case 2:
printf("Two\n");
break;
case 3:
printf("Three\n");
break;
case 4:
printf("Four\n");
break;
case 5:
printf("Five\n");
break;
case 6:
printf("Six\n");
break;
case 7:
printf("Seven\n");
break;
case 8:
printf("Eight\n");
break;
case 9:
printf("Nine\n");
break;
default:
printf("Number out of range\n");
break;
}
}

int main() {
int number,d1,d2,d3,d4,d5;

printf("Enter 5 digits between 0 and 9: ");

printf("digit1:\n");
scanf("%d",&d1);
while(d1>9){
printf("invalid input\n");
scanf("%d",&d1);
}

printf("digit2\n");
scanf("%d",&d2);
while(d2>9){
printf("invalid input\n");
scanf("%d",&d2);

}
printf("digit3\n");
scanf("%d",&d3);
while(d3>9){
printf("invalid input\n");
scanf("%d",&d3);
}

printf("digit4\n");
scanf("%d",&d4);
while(d4>9){
printf("invalid input\n");
scanf("%d",&d4);
}
printf("digit5\n");
scanf("%d",&d5);
while(d5>9){
printf("invalid input\n");
scanf("%d",&d5);

}
printf("array in words%d\n",convertNumberToText())

return 0;
}

You might also like