Hi guys, I have a problem with this question, where the amount is constantly $0 and at the end if the user enters Y/N it just closes without saying "Transaction Completed/Cancelled".
Any tips on how to fix it?
Thanks
#include<stdio.h>
#include <iostream>
#include<math.h>
int main()
{
int numofbees;
float price = 5;
char query;
char Y;
char N;
printf("How many bees would you like to purchase?\n");
scanf("%d", &numofbees);
printf("That will be $%d, confirm? (Y/N)\n", price*numofbees);
scanf("%c", &query);
if(query == Y)
printf("Transaction completed.");
else if(query == N)
printf("Transaction cancelled.");
getchar();
getchar();
return 0;
}