+ 2
What is cin
please help
4 Respostas
+ 7
cin is use for getting something from the user ....
eg.
int no ;
cout<<enter your number ;
cin>>no;
cout<<no;
+ 3
cin help us to input anything from user which we require in our program
+ 2
cin is for character input or some might say console input.It takes an input from user and later could store it in a variable or print the input using cout.
#include<iostream>
using namespace std;
int main(){
int user_input_variable;
cout<< "Enter input"<<endl;
cin>> user_input_variable;
cout<< "You entered "<< user_input_variable<< endl;
return 0;
}
Example..
Enter input
5
You entered 5
+ 1
cin is a predefined function used for reading values in a program .cin is in iostream header file