Home » , » Basic C Programming Practice - Practice 9

Basic C Programming Practice - Practice 9

Written By Unknown on Thursday, October 10, 2013 | 11:38 PM

=> Write a program in C to perform relational operations of two integer numbers?



Solution :

#include<stdio.h>
#include<conio.h>
main()
{
      int x,y;
      printf("Enter First Number : ");
      scanf("%d",&x);
      printf("Enter Second Number : ");
      scanf("%d",&y);
      if(x==y)
      printf("The Numbers Are Equal.");
      else
      if(x>y)
      printf("First Number Is Bigger Than Second.");
      else
      printf("Second Number Is Bigger Than First.");
      getch();

      }

Program Analysis :
The condition was to compare two integer number and that's why we declare integer data type variable "x" and "y" .First we take the first number from terminal or user and then we went for second.
We put the expressions and write this program by using a chain of  "if else if".That's It.................. 

Share this article :

Post a Comment

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Learn Programming - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger| Distributed by Rocking Templates