How do you store clear text | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

How do you store clear text

For example Int x; is for a number So how would this work Int main() { Int x; Cout << "What is your name?"; Cin >> x; Cout << "Ah, Your name is " << x << " Nice to meet you"; Sleep(10000) }

18th Feb 2017, 11:20 AM
Chandler
2 Réponses
+ 2
you need to set x as a string type not an int type. that code would make you ask the user for a number and say its name if for ex 2.
18th Feb 2017, 11:48 AM
Orfeo Terkuci
Orfeo Terkuci - avatar
0
Thank you #include <iostream> using namespace std; int main() { string a; int b; cout << "What is your name?\n\n"; cin >> a; cout << "How old are you\n\n"; cin >> b; cout << "Your name is " << a << "\n" << "You are " << b << " Years Old"; }
18th Feb 2017, 12:34 PM
Chandler