Answer to Question #274010 in Electrical Engineering for Malik

Question #274010

Write a program which prints the name and lawyer of each client whose age is L or higher.

(L is age variable) 


1
Expert's answer
2021-12-03T03:48:02-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS