0
What is the use of cin command
7 odpowiedzi
+ 3
#include <iostream> // add library to use cin cout commands
using namespace std;
int main() {
int age; // define variable
cin >> age; // ask user to input an integer value and assign it to age variable
cout<<"you are " << age << " years old"; // prints the output
}
+ 1
the cin command allows the user to enter a number or any variable
+ 1
Through cin command, we can extract data from the user.
0
get input from user(console)
e.g.,
int a;
cin>>a;
cout<<"You entered: "<<a;
// I have ignored the basic lines and have written just the logic .. ask if you want the whole
0
the cin command is same as the printf command in c language which prints the values on the screen
0
cin command is used to scan any value
in c++
0
no hole