ive been trying to create a c++ program that will display my name three times using the while loop but it keeps going wrong after all my try. please if anyone can help show me how is done i will be very grateful thanks
Then write a program to accept a name from the user and print it out.
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
#include <string>
int main()
{
std::string name ;
std::cout << "Please enter you name: " ;
std::getline( std::cin, name ) ;
std::cout << "your name is: " << name << '\n' ;
std::cin.get() ;
}
Make sure that you understand this before moving on to the next step.
For instance, look up std::string and std::getline()
Then move on to writing a loop to print the name three times.