Code:
#include<stdio.h>void main()
{
char letter;
char Results[4][3],row,column;
int count;
int admin[5];
int no_of_movie_tickets;
int no_of_pop_corn_packs;
int points;
printf("XYZ-ABC ONLINE MOVIE TREATS REDEMPTION SYSTEM \n"); //main menu
printf("(A) INPUT Redemption Status Check \n");
printf("(B) Redemption Status Check \n");
printf("(C) Display succesful redemptions \n");
printf("(D) Quit \n");
flushall();
{
for( int count=0; count<5; count++) //Function for case A, allows only 5 redemptions
{
printf("Please input your Admin No:"); //ask user for admin no
scanf("%d",&admin[count]);
printf("Number of movie tickets:");
scanf("%d",&no_of_movie_tickets); //ask user for no of movie tickets
printf("Number of pop corn packs:");
scanf("%d",&no_of_pop_corn_packs); //ask user for no of pop corn packs
printf("\n");
points = no_of_movie_tickets * 125 + no_of_pop_corn_packs * 75;
if(points<500)
{
printf("Redemption Status: Successful\n");
printf("Admin No:%d\n",admin[count]);
printf("Number of movie tickets:%d\n",no_of_movie_tickets);
printf("Number of pop corn packs:%d\n",no_of_pop_corn_packs);
printf("Redemption points used:%d\n\n",points);
}
else
{
count = count - 1;
printf("Redemption Status: Unsuccessful\n");
}
}
printf("Admin No.\t\tTickets\t\tPop_corn\t\tPoints\n");
for(int row=0;row<5;row++)
{
printf("%d\t\t\t%d\t\t\t%d\t\t\t%d\n",admin,no_of_movie_tickets,no_of_pop_corn_packs,points);
}
}
printf("Please try again tomorrow. Thankyou\n"); // after 5 successful attemptions, prints this out
}
i was told to remove the columns in my for loop() to prevent my row from over looping..problem settled.But...the data in my scanf does not print on my initialized array...help!
below is how my program displays...