Write A C++ Program To Input A Number Between 20 To 99 And
Display Its Numbername?

Answer Posted / sudha

#include<iostream>
#include<conio.h>
using namespace std;

int main()
{
string p[] =
{ "","","Twenty","Thirty","Fourty","Fifty","Sixty","Seventy","Eighty","Ninety" };
string o[] = { "","one", "two", "three", "four",
"five", "six", "seven", "eight", "nine" };

cout << "\n\nEnter a number between 20 to 99\n";
cin >> n;

i=n/10;
j=n%10;

cout << p[i] <<" " << o[j] << endl;

getch();
return(0);
}

Is This Answer Correct ?    24 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

write a program to convert temperature from fa height into celcius and vise versa,use modular programming

2549


Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)

4577


write a program to perform generic sort in arrays?

2716


What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }

678


write a program that reads a series of strings and prints only those strings begging with letter "b"

2760






1+1/2!+1/3!+...+1/n!

2051


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2328


How can I Draw an ellipse in 3d space and color it by using graph3d?

2230


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

3395


Implement a command console for changing settings on a particular object. The command console should allow you to enter a string and will return the response (very similar to a terminal session). The commands are as follows: SET propertyname=newvalue will change the target object’s member named “propertyname” to have a value equal to “newvalue”. If the input value is incompatible (i.e. an int being set to a string), print out an appropriate error message. GET propertyname will print out the current value of the target object’s member named “propertyname”. GET * will print out a list of all target object members and their current values. The system should be extensible for future commands and should accept an arbitrary object, such that another developer could insert another object into the system and rely on the command console to get and set the properties correctly.

3495


Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.

4649


can you please write a program for deadlock that can detect deadlock and to prevent deadlock.

2839


write a program that can LOCATE and INSERT elements in array using c++ programming languages.

3542


i don't know about working of nested for loop can any one help me

1894


find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L

2130