Write a program in c to input a 5 digit number and print it
in words.

Answer Posted / sachin patel

#include<stdio.h>
#include<conio.h>
void main()
{
int no;
printf("Enter the no");
scanf("%d",&no);
switch(no)
{
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("You entered Wrong input");
break;
}
}

Is This Answer Correct ?    8 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a list in c?

623


How many levels of indirection in pointers can you have in a single declaration?

598


Who developed c language and when?

588


The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.

1637


What is string in c language?

630






How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?

616


Can static variables be declared in a header file?

620


List the difference between a 'copy constructor' and a 'assignment operator' in C?

645


What is sizeof c?

612


Why c is called free form language?

575


What is a stream?

655


What is indirection in c?

631


disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit

1633


What are the advantages and disadvantages of c language?

567


How can you tell whether a program was compiled using c versus c++?

622