C Language

June 9, 2023

How to use function find the larger number in C Language

Program to use function find the larger number in C Language


#include <stdio.h>
int larger(int x, int y);
int main(void)
{
    int x, y;
    printf("Enter two number :");
    scanf("%d %d", &x, &y);
    printf("Larger number=%d\n", larger(x, y));
    return 0;
}
int larger(int x, int y)
{
    return x > y ? x : y;
}

Output


Enter two number :15
9
Larger number=15

Tags:

by : Nadeem Khan

Quick Summary:

Program to use function find the larger number in C Language copy #include <stdio.h> int larger(int x, int y); int main(void) { int x, y; printf(“Enter two number :”); scanf(“%d %d”, &x, &y); printf(“Larger number=%d\n”, larger(x, y)); return 0; } int larger(int x, int y) { return x > y ? x : y; } […]