Horje
Relational Operator in C language Code Example
Relational Operator in C language
#include<stdio.h>
int main(){

int a = 20;
int b = 10;
int c;

// == operator
if(a == b){
 printf(“a is equal to b\n”);
}else{
 printf(“a is not equal to b\n”);
}

// > operator
if(a > b){
 printf(“a is greater than b\n”);
}else{
 printf(“a is not greater than b\n”);
}

// < operator
if(a < b){
 printf(“a is less than b\n”);
}else{
 printf(“a is not less than b\n”);
}

// != Opertor
if(a != b){
 printf(“a is not equal to b\n”);
}else{
 printf(“a is equal to b\n”);
}

// >= orperator
if(a >= b){
 printf(“a is greater than or equal to b\n”);
}else{
 printf(“a is not greater than or equal to b\n”);
}

// <= operator
if(a <= b){
 printf(“a is less than or equal to b\n”);
}else{
 printf(“a is not less than or equal to b\n”);
}

}




C

Related
v Code Example v Code Example
script in c Code Example script in c Code Example
make a function makefile Code Example make a function makefile Code Example
confirm sweet alert Code Example confirm sweet alert Code Example
string to doublein c Code Example string to doublein c Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8