Search C Program | nimishsoft@gmail.com

Find larger value between two variable


/* Find larger value between two variable */

#include<stdio.h>
int main()
{
    int a,b;
    printf("Enter value of a: ");
    scanf("%d",&a);
    printf("Enter value of b: ");
    scanf("%d",&b);   
   
    if(a>b)
        printf("A is larger");
    else if(b>a)
        printf("B is larger");
    else
        printf("A and B are equal");
    return 0;
}

Related Post:
Largest value of two variables - Conditional Operator
http://cbasicprogram.blogspot.in/2012/01/largest-value-of-two-variables.html

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Basic Number Pattern Programs In Java
    Read Now

    ReplyDelete
  3. Great article! Finding the larger number between two numbers is a fundamental concept in mathematics and programming. It's essential for various applications, from simple calculations to complex algorithms.

    ReplyDelete