I'm trying to create a mad lib,
#include <iostream>
#include <string>
using namespace std;
int main()
{
int age1;
cout << "Enter your age: ";
cin >> age1;
cout << "You are " << age1 + 80 << "years old" << endl;
string product, liquid, disease, movie;
cout << "Enter a product: ";
getline(cin, product);
cout << "Enter a liquid: ";
getline(cin, liquid);
cout << "Enter a disease: ";
getline(cin, disease);
cout << "Enter a movie: ";
getline(cin, movie);
cout << "You walked to the store to buy some " << product << endl;
cout << "You slipped and fell on some " << liquid << endl;
cout << "You went to the hospital and got " << disease << endl;
cout << "You went home and watched " << movie << endl;
return 0;
{
Where there is "Enter a product" and below it "Enter a liquid", when I run it they are both side by side (Enter a product: Enter a liquid: ), it doesn't let you enter a value for the "product", whereas the next do are not side by side. Any solution?