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;

}

This is really a C program, which should be in the C forum. You wanted to stay on "AT&T Boulevard" but take a left on Ritchie Street instead of taking a right on to Stroustrup Lane.

Try dropping a getchar(); statement at the end of the program before your return statement.

Also please use code tags next time. //your code here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.