C Program to Find Minor Students Using an Array

 #include<stdio.h>

int main()

{

    int a[75], i;


    printf("Enter the age of 3 students: ");


    for(i=0;i<3;i++)

    {

        scanf("%d",&a[i]);

    }


    for(i=0;i<3;i++)

    {

        if(a[i] < 18)

        {

            printf("\nStudent no: %d is minor with age %d", i+1, a[i]);

        }

    }

}

Comments

Popular posts from this blog

Single Program Using All Automatic String Functions

C program for subtraction of two matrices (2D Arrays)

C program for Multiplication of Two matrices