write c++ program to input a student type ('A' or 'B'). if a student type is 'A' initialize the college account Rs.200/- otherwise initialize the hostel account rs.200/-?
1
Expert's answer
2012-10-09T09:20:31-0400
include<stdio.h> #include<conio.h> void main() { clrscr(); char x; printf("Enter the category of student: A or B "); scanf("%c",&x); if(x=='A') { int college = 200; printf(" Amount initialized to college account "); printf("Amount added to college account = %d",college); } else if(x=='B') { int hostel = 200; printf(" Amount initialized to hostel account "); printf("Amount added to hostel account = %d",hostel); } getch(); }
Comments
Leave a comment