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

write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n

2364


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.)

4445


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; }

639


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

3262


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!!!)

3268






how to take time as input in the format (12:02:13) from user so that controls remains between these columns?

1813


Write a simple encryption program using string function which apply the substitution method.

5531


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

1788


How to Split Strings with Regex in Managed C++ Applications?

3120


write a program that reverses the input number of n.Formulate an equation to come up with the answer.

7030


how to diplay a external image of output on winxp by using c & c++,

2931


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.

4392


Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.

3389


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

2130


Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++

546