Write a program which prints the name and lawyer of each client whose age is L or higher.
(L is age variable)
#include <stdio.h>
#include <stdlib.h>
int main(){
int L,K,age,i;
char clientName[50];
char lawyerName[50];
printf("Input the L: ");
scanf("%d",&L);
printf("Input the number of clients : ");
scanf("%d",&K);
for(i=1;i<=K;i++){
printf("Enter the client name %d: ",i);
scanf("%s",clientName);
printf("Enter the client age %d: ",i);
scanf("%d",&age);
printf("Enter the client lawyer name %d: ",i);
scanf("%s",lawyerName);
if(age>=L){
printf("The client name: %s\n",clientName);
printf("The client lawyer name: %s\n",lawyerName);
printf("The client age: %d\n",age);
}
}
getchar();
getchar();
return 0;
}
Comments
Leave a comment