0
Code coach help
Please help me with this I'm giving correct code I think but error showing #include <stdio.h> int main(){ int mileage, months; //==variable declararations new school====== scanf("%d, %d", &mileage, &months);//taking two inputs if (mileage >10000 || months>12){ printf("Change the oil"); //comparing using || operator } else{ printf("Its ok");; } return 0; } /*feel free to give feedbacks thank you for reviewing*/
2 Réponses
0
there is a comma-bug inside the scanf function. you don't need it....
and also printf() is a great tool! just to know what will the code ask.
for instance:
printf("Enter mileage and months (e.g., 10850 7): ");
scanf("%d %d", &mileage, &months);
I hope this helps
0
Give a complete task description:
You are making an app that should remind you when its the time to change the oil in your car.
The oil needs to change if the mileage after the last change is over 10000, or if the last oil change has been over 12 months ago.
Task:
Take the mileage and months values from input and output "Change Oil", in case the conditions above are satisfied.
In case its not the time for an oil change, output "OK".
You're output must be EXACTLY as described in the instruction: "OK" or "Change Oil". WORDING + SPELLING.
DO NOT print anything else on screen.