We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Rule 1: The increment and
byte, short, int, long, double,decrement
float, char) operators can be applied to all numeric datatype Rule 2: The increment and constants. decrement operators can be applied to only Rule3: The increment and variables, not to decrement operators cannot be nested. 3) Assignment Operators: This operator can be used for assignment operator is = assigning a value to a variable. The The assignment operator will copy the value from right side to left side.On the right can specify either a variable or a value or an side we specify onlya variable. expression etc. but on the left side we must
Example: X=5,y=X, Z=X+y
The assignment operators can be nested after the declaration of the variables. declaration of variable but not during the int a=b=c=d-6; not valid because nested during declaration int a, b, c, d; a=b=c=d=6; valid because nested after declaration int a=6,b=6,c=6,d-6; valid because there is no nesting If the assignment operator is combined with other operators then it is called as compound assignment operator(t= -= *= E %=). 4) Relational Operators: These operators can be used for comparing the values. These operators are also called as comparison operators. The various relational operators are <, <=, >, >=,==, != The relational operators can be used for creating conditions. Example: x<y x>y X>=y X==y The result of the condition will be of boolean type, i.e. if the condition is satisfied, then the result willbe true, otherwise the result will be false. Rule 1: The relational operators <, <=, >, >=, can be applied to any combination of numeric types only. Rule 2: The relational operators==, != also called as equality operatorscan be applied to any combination of numeric types or any combination of boolean types, but not tomixed types, i.e. one boolean andone numeric data. 5) Logical Operators: The logical operators can be used for combining the conditions or complimenting the result of a condition. The various logical operators are &, &&, I, II, A, !