C Language

June 8, 2023

How to use function understand the return statement in C Language

Program to use function understand the return statement in C Language


#include lt&;stdio.h>
void selection(int age, float ht);
int main(void)
{
    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:19
Selected

Tags:

by : Nadeem Khan

Quick Summary:

Program to use function understand the return statement in C Language copy #include lt&;stdio.h> void selection(int age, float ht); int main(void) { 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 […]