Relational Operators

Relational Operators:-

The following area the Relational Operators:-

  • Equality Relational Operator(==)
  • Not Equality Relational Operators (!=)
  • Less then Relational Operators(<)
  • Less then Or Equal to Relational Operators(<=)
  • Greater then Relational Operators(>)
  • Greater then Or Equal to Relational Operators(>=)

These operators are giving the boolean result either true or false

so the output will be used in the condition making statements/Branching statements.
The example of pseudo code for this is as below:--

begin

if var1== var2 then
   perform the statements.
else
  perform the others statements.
end if;



if var1!= var2 then
   perform the statements.
else
  perform the others statements.
end if;

if var1< var2 then
   perform the statements.
else
  perform the others statements.
end if;


if var1<= var2 then
   perform the statements.
else
  perform the others statements.
end if;


if var1> var2 then
   perform the statements.
else
  perform the others statements.
end if;

if var1>= var2 then
   perform the statements.
else
  perform the others statements.
end if;







No comments:

Post a Comment