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)
#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;
}
Comments
Leave a comment