Program to accept any single digit number and print it in words - 100 Most Important C# Programs

100 Most Important C# Programs

33. Program to accept any single digit number and print it in words .

Code:

# include <stdio.h>

# include <conio.h>

main( )

{

int n;

clrscr( );

printf(“enter a number :”);

scanf(“%d “,&n);

switch(n)

{

case 0: printf(“ZERO”);

break;

case 1: printf(“ONE”);

break;

case 2: printf(“TWO”);

break;

case 3: printf(“THREE”);

break;

case 4: printf(“FOUR”);

break;

case 5: printf(“FIVE”);

break;

case 6: printf(“SIX”);

break;

case 7: printf(“SEVEN”);

break;

case 8: printf(“EIGHT”);

break;

case 9: printf(“NINE”);

break;

default:

printf(“please enter the number between 0

and 9”);

}

getch( );

}





All materials on the site are licensed Creative Commons Attribution-Sharealike 3.0 Unported CC BY-SA 3.0 & GNU Free Documentation License (GFDL)

If you are the copyright holder of any material contained on our site and intend to remove it, please contact our site administrator for approval.

© 2016-2025 All site design rights belong to S.Y.A.