Professional Documents
Culture Documents
Session 3
Session 3
Introduction
Operators are:
Are a set of characters
Operands
result =
answer =
ans =
result =
answer =
Multiplication operator
cout<<"The distance covered by the vehicle = " ; cout<< f_dist ; cout << endl ; }
-++
Assignment operator
Assignment operator
Multiple assignment
int var_1, var_1 = 70 var_2 = 70 var_3 = 70 var_2, var_3 ; ; ; ;
qual == 10 || age == 18
X = 5 * 6.7 ;
intege r float
No error
Integer converted to double automatically
Linux, C, C++ / Object Oriented Programming with C++ / Session 3 / 24 of 33
Conversion table
Integer values
Integer values
Value is changed
Linux, C, C++ / Object Oriented Programming with C++ / Session 3 / 27 of 33
float a ; (int) a ;
Linux, C, C++ / Object Oriented Programming with C++ / Session 3 / 29 of 33
Ans= 3
Linux, C, C++ / Object Oriented Programming with C++ / Session 3 / 30 of 33
+, -, /, *, %