Write a C program to find maximum between two numbers

Q. Write a C program to find maximum between two numbers.

				
					#include<stdio.h>

void main()
{
    //Declare two integers
    int a,b;

    //Input the two integers
    printf("Enter Integer 1:");
    scanf("%d",&a);

    printf("Enter Integer 2:");
    scanf("%d",&b);

    //Use if - else  to compare the two integers

    if( a > b)
    {
        printf("Integer 1 is greater");
    }

    else
    {
        printf("Integer 2 is greater");
    }

}
				
			
Join To Get Our Newsletter
Spread the love