Write A C++ Program To Input A Number Between 20 To 99 And
Display Its Numbername?
Answer Posted / vinay tiwari
#include<iostream.h>
#include<conio.h>
void main()
{
char a[9][10]=
{"one","two","three","four","five","six","seven","eight","ni
ne"};
char b[8][10]=
{"twenty","thirty","fourty","fifty","sixty","seventy","eight
y","ninety"};
int num,rem;
clrscr();
cout<<"enter number "<<"\n";
cin>>num;
rem=num%10;
num=num/10;
if(rem==0)
cout<<b[num-2]<<"\n";
else
cout<<b[num-2]<<" "<<a[rem-1];
getch();
}
Is This Answer Correct ? | 18 Yes | 4 No |
Post New Answer View All Answers
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
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
how to write a program that opens a file and display in reverse order?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
Code for Two Classes for Doing Gzip in Memory?
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)
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
develop a program to calculate and print body mass index for 200 employees
Code for Easily Using Hash Table?
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!!!)
Code for Method of Handling Factorials of Any Size?
how to take time as input in the format (12:02:13) from user so that controls remains between these columns?
Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?
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; }
We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character