Write a program to print the given number in words using switch..case.

/* Write a program to print the given number in words using switch..case.*/

#include <stdio.h>

void main()

{

    int n;

    printf("Enter the number : ");

    scanf("%d",&n);

    switch(n)

    {

    case 1:

        printf("One\n");

        break;

    case 2:

        printf("Two\n");

        break;

    case 3:

        printf("Three\n");

        break;

    default:

        printf("Outside Range\n");

    }

    getch();

}

Comments

Popular posts from this blog

Write a program to accept numerator and denominator and find the remainder without using modulus (%) operator using do..while loop.