Program to print number into words from 0 to 9 using switch case in C-language

#include<stdio.h>
int main()
{
int no;
printf("Enter number between 0 to 9\n");
scanf("%d",&no);
switch(no)
{
  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("Invalid input");
}
}

OUTPUT
Enter number between 0 to9
5
Five

Comments

Popular posts

Creative pattern of butterfly in C-language

Program to show present time and date in C-language

Introduction of C-language.

Program to cheque enter number is a perfect number or not using if else in C-language

Program to cheque four digits number is palindrome or not in C-language

Program to print the cube of a number in c-language

Simple Hello world program in c- language