• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
projectsgeek

ProjectsGeek

Download Mini projects with Source Code, Java projects with Source Codes

  • Home
  • Java Projects
  • C++ Projects
  • VB Projects
  • PHP projects
  • .Net Projects
  • NodeJs Projects
  • Android Projects
    • Project Ideas
      • Final Year Project Ideas
      • JSP Projects
  • Assignment Codes
    • Fundamentals of Programming Language
    • Software Design Laboratory
    • Data Structure and Files Lab
    • Computer Graphics Lab
    • Object Oriented Programming Lab
    • Assembly Codes
  • School Projects
  • Forum

Display numbers as English word in C Language

July 8, 2013 by ProjectsGeek Leave a Comment

Display numbers as English word in C Language

Write a Display numbers as English word program in C to read an integer and display each of the digit of the integer in English.User has to provide a number which will be printed as English word on the screen.

You can take an example of 2345 will be printed as two three four five.

Display numbers as English word in C Code

#include <stdio.h>

void main ()
{
int number, digit1, digit2, digit3, digit4, digit5;
clrscr();
printf(“Enter a number (max 5 digits): “);
scanf(“%i”, &number);

if (number < 100000)
{
digit1 = number % 100000 / 10000;

switch (digit1)
{
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(“Unknown Interger “); break;
}

digit2 = number % 10000 / 1000;

switch (digit2)
{
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(“Unknown Interger “); break;
}

digit3 = number % 1000 / 100;

switch (digit3)
{
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(“Unknown Interger “); break;
}

digit4 = number % 100 / 10;

switch (digit4)
{
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(“Unknown Interger “); break;
}

digit5 = number % 10;

switch (digit5)
{
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(“Unknown Interger “); break;
}
}
else
{
printf(“Entered Number is too long.”);
}
getch();
}

 

Other Projects to Try:

  1. How to Implement Hash Table using C language
  2. Matrix operations in c language
  3. Hash table code in C Language
  4. String Operations in C Language
  5. Display Numbers in Ascending Order C language

Filed Under: Uncategorized

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Tags

.Net Projects Download Android Project Ideas Android Projects Angular 2 Assembly Codes C # Projects C & C++ Projects C++ Projects Class Diagrams Computer Graphics Database Project Data Mining Projects DataScience Projects Datastructure Assignments Download Visual Basic Projects Electronics project Hadoop Projects Installation Guides Internet of Things Project IOS Projects Java Java Interview Questions Java Projects JavaScript JavaScript Projects java tutorial JSON JSP Projects Mechanical Projects Mongodb Networking Projects Node JS Projects OS Problems php Projects Placement Papers Project Ideas Python Projects seminar and presentation Struts

Search this Website


Footer

Download Java Project
Download Visual Basic Projects
Download .Net Projects
Download VB Projects
Download C++ Projects
Download NodeJs Projects
Download School Projects
Download School Projects
Ask Questions - Forum
Latest Projects Ideas
Assembly Codes
Datastructure Assignments
Computer Graphics Lab
Operating system Lab
australia-and-India-flag
  • Home
  • About me
  • Contact Form
  • Submit Your Work
  • Site Map
  • Privacy Policy