The program is to output the total amount for cinema ticket of different category.
I compile it with no error but the window disappears when i enter number of ticket.
Can someone help me check what's wrong with my code or formula?
Totally idea with it :(
/*Cinema Ticket Ordering System*/
# include <stdio.h>
int main (void)
{
int price,no_ticket,total_amt,class_code;
printf ("Welcome to our cinema ticket ordering system,\n1 for
VIP class (RM12) \n2 for first class(RM10) \n3 for normal class
(RM8)\nPlease enter the code of class that you want:");
scanf ("%d",&class_code);
if (class_code==1)
{
printf ("Enter number of ticket");
scanf ("%d",&no_ticket);
price=12,
total_amt=no_ticket*12;
printf ("The total amount of ticket is:%d",total_amt);
}
else
if (class_code==2)
{
printf ("Enter number of ticket");
scanf ("%d",&no_ticket);
price=10;
total_amt=no_ticket*price;
printf ("The total amount of ticket is:%d",total_amt);
}
else
{
printf ("Enter number of ticket");
scanf ("%d",&no_ticket);
price=8;
total_amt=no_ticket*price;
printf ("The total amount of ticket
is:%d",total_amt);
}
return 0;
}