I am writing a program and in line 50 it marks me this: Warning: Initialization makes integer from pointer without a cast. How do I fix it? The problem started when I had to create a loop to ask whether yes or no if the user would like to calculate another trip. I do not know how to fix. Please help.
Code:
#include <stdio.h>
int main(void)
{
float numP, numL, HalfCost, EachLcost, TotalHalf, TotalCost, ans;
int loop;
printf("\nPlease enter the number of passengers. Children under the age 12 are represented by .5: ");
scanf("%f",&numP);
if (numP<0 )
numP=3;
else
printf ("%f",numP);
printf ("\nHow many legs the trip has to get to the destination?");
scanf("%f",&numL);
TotalHalf = 0;
loop=1;
while (loop <= numL){
printf("\nWhat is the price of leg %d?",loop);
scanf("%f",&EachLcost);
TotalHalf =TotalHalf + EachLcost;
loop++;
}
printf("\nThe total cost for half the trip is:");
if(TotalHalf>0)
printf("%f",TotalHalf);
TotalCost=TotalHalf*2;
printf("\nThe round trip cost for one person is: $ %f",TotalCost);
printf("\nThe round trip cost for %f persons is: $ %f",numP, TotalCost*numP);
// return TotalCost*numP;
printf("\nWould you like to calculate another trip cost? (Y/N)?");
scanf("%c",&ans);
if(ans == 'Y')
return main;
else(ans== 'N');
printf("\nThank You!");
return TotalCost*numP;
}