Learn C ProgrammingLearn ProgrammingPrograms On Decision Control StructuresResources

020. Write a program to accept two numbers from user and compare them in C language

By September 18, 2012 February 5th, 2018 2 Comments
#include<stdio.h>
#include<conio.h>  
main()
{
 int a,b;
 clrscr();
 printf("Enter numbers...");
 scanf("%d%d",&a,&b);
 if(a>b)
	printf("a is greater than b");
 else if(b>a)
	printf("b is greater than a");
 else
	printf("both are equal");
 getch();
}


2 Comments

Leave a Reply

DEMO01