Mega Code Archive

 
Categories / C / Code Snippets
 

Logical operator

#include<stdio.h> main( ) { int j1,j2,j3; printf("enter value for j1, j2,j3"); scanf("%d%d%d",&j1,&j2,&j3); if((j1 < j2)&&(j1<j3)) printf("\n j1 is less than j2 and j3"); if (!(j1< j2)) printf("\n j1 is greater than j2"); if ((j1 < j2)||(j1 < j3)) printf("\n j1 is less than j2 or j3 or both"); }