Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

Level 11 lesson 6

Not getting
by

5 Answers

sam5epi0l
Are you not getting the whole lesson or the exercise instructions. Please let us know.
8unknown
I am not getting exercise

#include <stdio.h>

float calculatePrice(float price, int discount) {
float finalPrice = price - (price * discount / 100);
return finalPrice;
}

int main() {
float fp = calculatePrice(150.0, 10);
printf("The price is %.1f\n", fp);
return 0;
}





This is exercise
When I submit it says that 1st parameter of calculate price function shoul be price
I already write it.

Thank you for considering my problem.
sam5epi0l
Please try again with the same. Let us know if you face the same error.
iamabhishek
Thank you for letting us know, we have fixed few parts of the exercise. Your code is correct. Please try this code:

#include <stdio.h>

float calculatePrice(float price, int discount) {
float finalPrice = price - (price * discount / 100);
return finalPrice;
}

int main() {
float fp = calculatePrice(150, 10);
printf("The price is %.1f", fp);
return 0;
}
8unknown
Thank you very much sir it's working.

Login / Signup to Answer the Question.