Biggest of Two Numbers in C Language

  • Initially, we will declare three integer numbers such as a, b, and c, and another integer variable “big” that stores the biggest number after the execution of the program.
  • ‘a’ is compared with ‘b’. If a is greater than b then a will be considered biggest and stored to the resultant variable ‘big’ otherwise ‘b’ will be considered biggest and stored to the resultant variable big.

Below is an example to find biggest of two numbers in C language

#include <stdio.h> 
main()
{
int a, b, big;
printf("\n Enter the two numbers: ");
scanf("%d %d",&a, &b);
if(a>b)
{
big = a;
}
else
{
big = b;
}
printf("\n The biggest of two numbers is: %d",big);
}

--

--

Hi, This is Biplab and I am web developer well versed in PHP and other open source technologies. I am here to share my experience with the community.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Bipsmedium

Bipsmedium

Hi, This is Biplab and I am web developer well versed in PHP and other open source technologies. I am here to share my experience with the community.