📖 Samacheer Kalvi · 11th TN - English Medium · Computer Science · Page 138question

Data Types, Variables and Expressions · Part 14

Chapter 3: 4 · Computer Science

with simple arithmetic operators to produce integer results. sum=num1+num2; avg=sum/ ; Float Expression The combination of floating point values and/or variables with simple arithmetic operators to produce floating point results. Area= . *r*r; R e l a t i o n a l E x p r e s s i o n The combination of values and/or variables with relational operators to produce bool(true means or false means ) values as results.

x>y; a+b==c+d; L o g i c a l E x p r e s s i o n The combination of values and/or variables with Logical operators to produce bool values as results. (a>b)&& (c== ); B i t w i s e E x p r e s s i o n The combination of values and/or variables with Bitwise operators. x>> ; a<< ; P o i n t e r E x p r e s s i o n A Pointer is a variable that holds a memory address. Pointer variables are declared using (✳) symbol.

int *ptr; Table . : Types of Expressions Chapter Page - - . Type Conversion The process of converting one fundamental data type into another is called as “Type Conversion”. C++ provides two types of conversions.

( ) Implicit type conversion ( ) Explicit type conversion. ( ) Implicit type conversion: An Implicit type conversion is a conversion performed by the compiler automatically. So, implicit conversion is also called as “Automatic conversion”. This type of conversion is applied usually whenever different data types are intermixed in an expression.

If the type of the operands differ, the compiler converts one of them to match with the other, using the rule that the “smaller” type is converted to the “wider” type, which is called as “Type Promotion”. For example: #include <iostream> using namespace std; int main() int a= ; float b= . ; cout << a+b; In the above program, operand a is an int type and b is a float type. During the execution of the program, int is converted into a float, because a float is wider than

Related topics

Have a question about this topic?

Get an AI answer grounded in your actual textbook — with the exact page reference.

Ask AI about this topic →