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
write a program that reads a series of strings and prints only those strings begging with letter "b"
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.
output for printf("printf");
write a program that can LOCATE and INSERT elements in array using c++ programming languages.
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; }
how to take time as input in the format (12:02:13) from user so that controls remains between these columns?
How can I Draw an ellipse in 3d space and color it by using graph3d?
Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.
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
develop a program to calculate and print body mass index for 200 employees
1+1/2!+1/3!+...+1/n!
write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation
i really need help about this.. write a program to display the set of odd and even numbers separately. find the highest and lowest value of the given numbers.
How to swap two ASCII numbers?
write a program to perform generic sort in arrays?