Answer to Question #263931 in C for Hari

Question #263931

Students of 1st year will have choice of going to Physics Cycle or Chemistry Cycle of the academic curriculum. Teacher asks the student to enter the choice. If the choice is p, student is assigned Physics Cycle otherwise Chemistry Cycle. Software needs to be developed with following requirement:


1: Read the choice from the student


2: Check the choice


3: Display appropriate message (Physics Cycle or Chemistry Cycle)




1
Expert's answer
2021-11-10T06:33:31-0500
#include <stdio.h>
#include <stdlib.h>


int main(){
	char choice;
	printf("Enter the choice: ");
	scanf("%c",&choice);
	if(choice=='p'){
		printf("\nPhysics Cycle.\n");
	}else{
		printf("\nChemistry Cycle.\n");
	}
	


	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
New on Blog
APPROVED BY CLIENTS