0

write c++ program to read integer number and print the equivalent string ..e.g 0zero 1one 2 two..............

c++

19th Jan 2018, 9:34 AM
Zahraa Mohammed
Zahraa Mohammed - avatar
8 Réponses
+ 4
What have you tried?
19th Jan 2018, 9:45 AM
jay
jay - avatar
+ 3
#include <iostream> using namespace std; int main() { while (true) { int a = -1; cin >> a; if (a == -1) break; cout << (char)a << endl; } }
19th Jan 2018, 11:17 AM
Jacob Pembleton
Jacob Pembleton - avatar
0
A string will look the same as an integer on the console. Also, the ostream class converts every type to chars for storing inside a character buffer and printing on the console. So the difference will be seen only inside the code, nowhere else. And to convert int to string, use to_string() or stringstream.
19th Jan 2018, 10:07 AM
Solo Wanderer 4315
Solo Wanderer 4315 - avatar
0
write a program to read X and print sin X ifX>0 square rootX f<0 and absoluteX ifX/2 is integer
19th Jan 2018, 11:26 AM
Zahraa Mohammed
Zahraa Mohammed - avatar
0
11th May 2020, 3:52 AM
حيدر حسن الفتلاوي
حيدر حسن الفتلاوي - avatar
0
11th May 2020, 3:52 AM
حيدر حسن الفتلاوي
حيدر حسن الفتلاوي - avatar
0
11th May 2020, 3:52 AM
حيدر حسن الفتلاوي
حيدر حسن الفتلاوي - avatar
0
write c++ program to read integer number and print the equivalent string e.q zero one two
11th May 2020, 3:53 AM
حيدر حسن الفتلاوي
حيدر حسن الفتلاوي - avatar