Professional Documents
Culture Documents
ψ uΞpı̣ɐʞ ツ 🥇
#include <iostream>
using namespace std;
int main()
{
int age;
cout<<"enter your age:";//output asking
cin >> age; /taking imputs
cout<<"your age is:" << age << endl; oututinng the inputs to the screen
return 0;
}
#include <iostream>
using namespace std;
int main()
{//enter a char
char letter;
cout<<"enter a letter in the alphabet:";
cin >> letter;
cout<<"your letter was: " << letter << endl;
return 0;
}
#include <iostream>
using namespace std;
int main()
{//entering a single char
char letter;//setting the variable
cout<<"enter a letter in the alphabet:";//outputting the text
cin >> letter;//taking the char input
cout<<"your letter was: " << letter << endl;//outputting the cout then talking
putting the cin variable ofter
return 0;//returning 0
}
#include <iostream>
using namespace std;
int main()
{
string name;
string day;
string hday;
cout<<"whats your name?:";
cin >> name;
cout<<"Hi! "<<name;
cout<<"\nhow was your day? ";
cin >> day;
cout<<"thats great that your day was\n"<<day;
cout<<"\nwhat did you do today at school?\n"<<hday;
cin >> hday;
cout<<"ahh that is very cool";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
string name;
string enter;
string start;
std::string respond;
std::cout << "Press enter to start...\n";
std::cin.get();
std::cout << "Are you ready to start the quiz, " << name << "? Yes/No.\n";
std::cin >> respond;
cout<<"\nwhat is your name???\n";
cin >> name;
cout<<"\nHi! " << name ;
string q1;
string q2;
if ((q1 =="'WRONG! better luck next time!") || (q1 == "WRONG! better luck next
time!"))
{
cout << "howw you were the history teacher\n\n";
}
else if ((q1 == "A") || (q1 == "a"))
{
cout << "YAY! you got it right keep up the good work\n\n";
}
else
{
cout << "YAY! you got it right keep up the good work\n\n";
}
return 0;
}
#include <iostream>
using namespace std;
int main()
{
string name;
string enter;
string start;
std::string respond;
std::cout << "Press enter to start...\n";
std::cin.get();
std::cout << "Are you ready to start the quiz, " << name << "? Yes/No.\n";
std::cin >> respond;
cout<<"\nwhat is your name???\n";
cin >> name;
cout<<"\nHi! " << name ;
string q1;
string q2;
return 0;
}