How to use larger number in C language

program to use larger number in C language


#include<stdio.h>
int larger(int x,int y);
int main()
{
    int x,y;
    printf("Enter two numbers : ");
    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 numbers : 5
10
larger number=10

How to use return statement in C language

program to use return statement in C language


#include<stdio.h>
void selection(int age,float ht);
int main()
{
    int age;
    float ht;
    printf("Enter age and height : ");
    scanf("%d%f",&age,&ht);
    selection(age,ht);
    return 0;
}
void selection(int age,float ht)
{
    if(age>25)
    {
        printf("Age should be less than 25\n");
        return;
    }
    if(ht<5)
    {
        printf("Height should be more than 5\n");
        return;
    }
    printf("selected\n");
}

output


Enter age and height : 24
5
selected