Monday, April 13, 2020

Relational operators in C


  • Program :
#include <stdio.h>
#include<conio.h>
void main()
{
    int a,b;
    clrscr();
    printf("\n----------------RELATIONAL OPERATORS----------------");
    printf("\nEnter two values:");
    scanf("%d%d",&a,&b);
    printf("\n----------------RELATIONAL OPERATOR(==)----------------");
    printf("\n%d == %d is %d", a,b,a==b);
    printf("\n----------------RELATIONAL OPERATOR(>)----------------");
    printf("\n%d > %d is %d", a,b,a>b);
    printf("\n----------------RELATIONAL OPERATOR(<)----------------");
    printf("\n%d < %d is %d", a,b,a<b);
    printf("\n----------------RELATIONAL OPERATOR(!=)----------------");
    printf("\n%d != %d is %d", a,b,a!=b);
    printf("\n----------------RELATIONAL OPERATOR(>=)----------------");
    printf("\n%d >= %d is %d", a,b,a>=b);
    printf("\n----------------RELATIONAL OPERATOR(<=)----------------");
    printf("\n%d <= %d is %d", a,b,a<=b);
    getch();
}

  • Output :




No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...