C program to accept 10 names of the workers along with the age and salary. Display all the details whose age is more than 21 by using array.



//wap to accept 10 names of the workers along with the age and salary. Display all the details whose age is more than 21 by using array.


#include<stdio.h>

int main()

{

char name[25][10];

int age[10];

int salary[10];


for(int i=0; i<=9;i++)

{

printf("Enter your name");

scanf("%s",name[i]);

printf("Enter your age");

scanf("%c",&age[i]);

printf("Enter your salary");

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


}

for(int i=0;i<=9;i++)

{

if(age[i]>21)

{

printf("   %s",name[]);

printf("  %d",age[]);

printf("  %d",salary[]);

}

}


Post a Comment

0 Comments