everyone. I NEED HELP! I was trying to submit this following HackerRank's challenge : Task Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent (the percentage of the meal price being added as tax) for a meal, find and print the meal's total cost. Round the result to the nearest integer.
#include <stdio.h>
#include <math.h>
int main()
{
int tax,tip;
double mealc;
scanf("%f",&mealc);
scanf("d",&tip);
scanf("%d",&tax);
mealc = mealc+(mealc*tip/100))+(mealc*tax/100);
printf ("%d",round(mealc));
return 0;
}
After compiling the code above. I always get these errors :
Hk2.c:33:9: warning: format ‘%f’ expects argument of type ‘float *’, but argument 2 has type ‘double *’ [-Wformat=]
Hk2.c:37:11: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘double’ [-Wformat=]
What is the problem ?