+ 2
I don't understand com 100%
I still don't understand how to properly use cin. Its for input. But what does it mean to input. Like input num1 or num 2 I don't know what that does
9 Respuestas
+ 9
cin is the console input which is used to take input from user
cout is console output which is used to show the input number at console ex:-
#include <iostream>
int main() {
int a,b;
std::cin>>a>>b;//input
std::cout<<a*b;//output shows at console
return 0;
}
+ 3
cin assigns your input as a value to given variable
cin simply means (Console In) its reads input stream from your keyboard
Using GAWEN STEASY sample you can see that she has 2 variables that need input from keyboard(cin), once there value has been assigned these 2 variables are then multiplied together and displayed to console 👍
+ 3
cin is an object of class istream. It is used to accept the input from the standard input device
+ 1
you can assign by
int a;
a = 5;
see variable a is assigned with value 5.
its proper way to assign
u can assign value like this also
int a = 5;
+ 1
I can see clearly now the rain is gone
0
got it thanks a lot man I love this app everything is so much easier this way with immediate help
0
actually another question would be how to properly assign something to a variable
0
if u can assign a variable with out using cin then what do we need cin for any way pls use an example a 3rd grader could understand even though I'm in 9th
0
cin basically console input (cin)
its mean something coming from keyboard
by using cin, we make options for user that they can put their choice
suppose it there is a program to make a table so you can make a table of any digit which u put through cin function
here is a code in which 2 variables are given
a and length
https://code.sololearn.com/cwE3Gy0SutPO/?ref=app