Program to find largest of two numbers in C language. (program 07)

/*Made by Anmol main
Student B.tech Cse
Punjabi university
Hindustan Coding
Program 07*/

#include<stdio.h>
int main()
{   int a,b; //write the fixed values of a and b if not then take it from the user
    printf("Enter a number A \n");
    scanf("%d",&a);
    printf("Enter a number B\n");
    scanf("%d",&b);

    {   if (a>b)
            printf("\nThe number A = %d is Greater\n",a);
        else if (b>a)
            printf("\nThe number B = %d is Greater\n",b);

        else
            printf("\nEnter a valid integer\n",a);

    }
    return 0;
}

Comments

Popular posts from this blog

Glowing-Log-in-window-in-Pure-html-css #30

Program to swap 2 numbers by using 3 numbers, taking input from user in C language. #1

C program to print lengh of an array (program 20)