DSA AND C++
Completed
C++ input & operators
🔹 Input in C++
In C++, input is generally taken from the user using the cin object (stands for console input). It works with the extraction operator >>.
Example:
int age; cout << "Enter your age: "; cin >> age;
Here, the user enters a value which gets stored in the variable age.
🔹 Operators in C++
Operators are symbols that perform operations on variables and values. They are the building blocks of any program.
Arithmetic Operators → + , - , * , / , % (used for mathematical calculations)
Relational Operators → == , != , > , < , >= , <= (used for comparison, result is true/false)
Logical Operators → && , || , ! (used to combine conditions)
Assignment Operators → = , += , -= , *= , /= , %= (used to assign values)
Increment/Decrement Operators → ++ , -- (used to increase or decrease value by 1)
Bitwise Operators → & , | , ^ , ~ , << , >> (used for operations on binary numbers)
Ternary Operator → condition ? value1 : value2; (short form of if-else)
There are no comments for now.