top of page
 cin User write command 

In this lesson, we will explain one of the most beautiful programming commands that will open a new door for us and with it we can develop many applications, so let us begin:
Writing command from the usercin It allows the user to interact with the computer, and companies can use it in the case of automated response and obtaining the user’s personal data.
The writing style is like this:
cin>>name; is the tag bigger And not smallerWe do not put double quotation marks Because the writing will be from the user.

Project: Interacting with the user

#include<iostream>//We start by placing the libraries
using namespace std;//We start by placing the libraries
int main(){//main function
string firstname;// We define a variable of type text for the user to put his first name into
string lastname;// We define a variable of type text so that the user can put his second name into it
int age;// We define a variable of type integer in which the user can put his age
string games;// We define a variable of type text in which the user can place his detailed games
cout<<"what is your first name?"<<endl;
//We call a print command that asks the user for his first name
cin>>firstname;//We call the write command from the usertoHave him write his first name
cout<<"Oh I see, and what is your last name?"<<endl;
//We call a print command that asks the user for his second name
cin>>lastname;//We call the write command from the user to make him write his last name
cout<<"how old are you"<<endl;//We call a print command that asks the user about his age
cin>>age;//We call the write command from the user to make him write his age
cout<<"and may I ask What are the best games you ever played"<<endl;
//We call a print command that asks the user about his favorite games
cin>>games;//
We call the write command from the user to make him write his favorite games
cout<<"oh wow I like these games";

return 0;
}

image.png
bottom of page