From 942eb8f99ce93e9859d1a0022e81be8fb94e5f83 Mon Sep 17 00:00:00 2001 From: ydoco Date: Mon, 7 Feb 2022 11:37:08 -0800 Subject: [PATCH] fixed syntax errors --- main.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/main.cpp b/main.cpp index bb63cb8..47ef9c0 100644 --- a/main.cpp +++ b/main.cpp @@ -5,24 +5,25 @@ int main() { int age; string name; - char last initial; + char last_initial; - cout<<"Hi. What is your first name? " - cin<>last initial; - cout<<"Thanks, "<> name; + cout<< name << " ,what is the first letter of your last name? "; + cin>>last_initial; + cout<<"Thanks, "<< name << last_initial<<"."<>age>>endl; + cin>>age; if( age < 12 ) { cout<<"Hey kid, how do you like school?\n"; } - if( age < 18 ) - cout<<"Cool!"endl; + if( age < 18 ) { + cout<<"Cool!" << endl; cout<<"How's highschool going?\n"; - else( age >= 18 ); + } + else if( age >= 18 ); { cout<<"Pleased to meet you!\n"; }