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
What is a list in c?
How many levels of indirection in pointers can you have in a single declaration?
Who developed c language and when?
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.
What is string in c language?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
Can static variables be declared in a header file?
List the difference between a 'copy constructor' and a 'assignment operator' in C?
What is sizeof c?
Why c is called free form language?
What is a stream?
What is indirection in c?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
What are the advantages and disadvantages of c language?
How can you tell whether a program was compiled using c versus c++?