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)




Expert's answer

#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!

LATEST TUTORIALS
APPROVED BY CLIENTS