use the function scanf in form correct:
this correct is:
scanf("%s",str); //for strings
scanf("%d",&d); //for integers and floats and doubles
Code:
#include <stdio.h>
#include <string.h>
int main()
{
char answer[20];
char answer2[20];
char choiceone[20];
char choicetwo[20];
float total;
float choice1 = 0.95;
float choice2 = 1.25;
float choice3 = 1.00;
printf("May I take your order today?\n\r");
printf("Menu:\n\r");
printf("Choice1: Fries .95\n\r");
printf("Choice2: Cheese burger $1.25\n\r");
printf("Choice3: Lemonade $1.00\n\r");
printf("Those are your choices! Choose Choice1, Choice2 or Choice3 please.\n\r", choiceone);
scanf("%s",choiceone);
if (strcmp (choiceone, "choice1"))
{
total + choice1;
}
if (strcmp(choiceone, "choice2"))
{
total + choice2;
}
if (strcmp (choiceone, "choice3"))
{
total + choice3;
}
printf("You've chosen %s.\n\r", choiceone);
printf("Would you like something else?\n\r", answer);
scanf("%s", answer);
if (!strcmp (answer, "yes"))
{
printf("Menu:\n\r");
printf("Choice1: Fries .95\n\r");
printf("Choice2: Cheese burger $1.25\n\r");
printf("Choice3: Lemonade $1.00\n\r");
printf("Those are your choices! Choose one of those please.\n\r", choiceone);
scanf("%s",choiceone);
printf("You've chosen %s.\n\r", choiceone);
scanf("%s", choiceone);
printf("Anything else for you today?\n\r", answer);
scanf("%s",choicetwo);
return;
}
else if (!strcmp (answer, "no"))
{
printf("Your total comes to %f", total);
}
return 0;
}