C program for Relational Operators:
#include<stdio.h>
#include<conio.h>
main()
{
int a=10, b=4;
clrscr();
printf("\n(%d>%d) = %d",a,b,a>b);
printf("\n(%d<%d) = %d",a,b,a<b);
printf("\n(%d>=%d) = %d",a,b,a>=b);
printf("\n(%d<=%d) = %d",a,b,a<=b);
printf("\n(%d==%d) = %d",a,b,a==b);
printf("\n(%d!=%d) = %d",a,b,a!=b);
getch();
}
#include<stdio.h>
#include<conio.h>
main()
{
int a=10, b=4;
clrscr();
printf("\n(%d>%d) = %d",a,b,a>b);
printf("\n(%d<%d) = %d",a,b,a<b);
printf("\n(%d>=%d) = %d",a,b,a>=b);
printf("\n(%d<=%d) = %d",a,b,a<=b);
printf("\n(%d==%d) = %d",a,b,a==b);
printf("\n(%d!=%d) = %d",a,b,a!=b);
getch();
}
No comments:
Post a Comment