19. WAP to understand relational operators.
#include<stdio.h>
void
main()
{
/*
PART 1
int i,j;
printf("Enter i value : ");
scanf("%d",&i);
printf("Enter j value : ");
scanf("%d",&j);
printf("%d\n",i<j);
printf("%d\n",i<=j);
printf("%d\n",i>j);
printf("%d\n",i>=j);
printf("%d\n",i==j);
printf("%d\n",i!=j);
*/
/*
PART 2
int i,j;
printf("Enter i value : ");
scanf("%d",&i); // -1
printf("Enter j value : ");
scanf("%d",&j); // 5
printf("%d\n",i>j);
*/
/*
PART 3
unsigned int i;
int j;
printf("Enter i value : ");
scanf("%d",&i); // -1
printf("Enter j value : ");
scanf("%d",&j); // 5
printf("%d\n",i>j);
*/
/*
PART 4
int i;
unsigned int j;
printf("Enter i value : ");
scanf("%d",&i); // -1
printf("Enter j value : ");
scanf("%d",&j); // 5
printf("%d\n",i>j);
*/
/*
PART 5
int i=1,j=2,k=3,l=4,m;
m = i < j == k > i != l <= j;
printf("m=%d\n",m);
*/
/*
PART 6
printf("%d\n",1 + 2 <= 'a'
== 'b' - 5 >= 1 != 7 * 1);
*/
}
Comments
Post a Comment