Answer to Question #16015 in C++ for anika

Question #16015
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();
}

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