AllFreePapers.com - All Free Papers and Essays for All Students
Search

Types of Operator

Autor:   •  February 6, 2016  •  Exam  •  1,254 Words (6 Pages)  •  818 Views

Page 1 of 6

OPERATORS

TYPES OF OPERATOR

  • Arithmetic operators
  • Relational operators
  • Logical / Boolean operators

Arithmetic Operators

  • Arithmetic operators are also known as mathematical operators;.
  • These are used to combine two or more numbers and return a numeric result.

Addition                +

Subtraction                 –

Multiplication                 *

Division                  /

Modulus                  %

Hierarchy of Arithmetic Operators

[pic 1]

Relational Operators

  • Relational operators are used to compare quantitative values.
  • It is answerable by YES (1) or NO (0).

Less than                   <

Greater than                    >

Less than or equal           <=

Greater than or equal            >=        

Equal                             ==

Not equal                   !=

Hierarchy of Relational Operators

[pic 2]

Logical Operators

  • Logical operators are used to compare values using truth table.
  • It is answerable by TRUE (1) or FALSE (0).

        AND                        &&

        OR                             ||

        NOT                             !

Hierarchy of Logical Operators

[pic 3]

NOT Operator (!)

[pic 4]

The result is always the opposite of its value.

AND Operator (&&)

[pic 5]

The result is always FALSE if at least one of its value is FALSE.

OR Operator (||)

[pic 6]

The result is always TRUE if at least one of its value is TRUE.

Data type

  • It is used in determining the kind and possible range of values that variables and constants will contain during program execution.

Basic Data Types

[pic 7]

Format Specifier

It reads the type of data to be accepted or displayed.

...

Download as:   txt (4.1 Kb)   pdf (430.9 Kb)   docx (193.9 Kb)  
Continue for 5 more pages »