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

Answer Posted / pavan mustyala

#include<iostream>
using namespace std;

void main()
{
char *arr1[9]=
{"one","two","three","four","five","six","seven","eight","ni
ne"};
char *arr2[8]=
{"twenty","thirty","fourty","fifty","sixty","seventy","eight
y","ninety"};
int num;

cout << "Enter A Number:"<< endl;
cin >> num;

cout << arr2[(num / 10) - 2];

if((num % 10) != 0)
cout << " " << arr1[(num % 10) -1];
}

Is This Answer Correct ?    4 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37

2198


Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?

7344


How to swap two ASCII numbers?

2451


write a program using virtual function to find the transposing of a square matrix?

2845


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

1794






write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used

4310


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

2674


Definition of priority queue was given. We have to implement the priority queue using array of pointers with the priorities given in the range 1..n. The array could be accessed using the variable top. The list corresponding to the array elements contains the items having the priority as the array index. Adding an item would require changing the value of top if it has higher priority than top. Extracting an item would require deleting the first element from the corresponding queue. The following class was given: class PriorityQueue { int *Data[100]; int top; public: void put(int item, int priority); // inserts the item with the given priority. int get(int priority); // extract the element with the given priority. int count(); // returns the total elements in the priority queue. int isEmpty(); // check whether the priority queue is empty or not. }; We had to implement all these class functions.

4398


Code for Two Classes for Doing Gzip in Memory?

2814


write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150

3270


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

2010


What output does the following code generate? Why? What output does it generate if you make A::Foo() a pure virtual function? class A { A() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; class B : public A { B() { this->Foo(); } virtual void Foo() { cout << "A::Foo()" << endl; } }; int main(int, char**) { A objectA; B objectB; return 0; }

644


U hv to enter a range from a and b and search hw many no. of times a pattern n. occurs between the range a and b. Eg :i/p:enter range :0 100 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 0 to 100:1 Eg :i/p:enter range :100 1000 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 100 to 1000: (in this 13,113,131,132,133…139,213,313,…913 all these will be counted)

2127


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

2138


develop a program to calculate and print body mass index for 200 employees

2216