0

write a program to input a digit and print it in words?

18th Sep 2016, 6:47 PM
Prakhar
Prakhar - avatar
2 Antworten
- 1
#include <iostream> using namespace std; int main() { int x; cin >> x; switch(x) { case 0: cout << "Zero" <<endl; break; case 1: cout << "One" <<endl; break; case 2: cout << "Two" <<endl; break; case 3: cout << "Three" <<endl; break; case 4: cout << "Four" <<endl; break; case 5: cout <<"Five" <<endl; break; case 6: cout << "Six" <<endl; break; case 7: cout << "Seven" <<endl; break; case 8: cout << "Eight" <<endl; break; case 9: cout << "Nine" <<endl; break; default: cout << "Wrong Input" <<endl; break; } return 0; }
18th Sep 2016, 7:00 PM
Mosiur Rahman
Mosiur Rahman - avatar
- 1
Is this code complete or still something in it to put in order. To complete the program???
30th Jul 2019, 5:39 PM
Shubham Bhatt
Shubham Bhatt - avatar