#include <cs50.h>
#include<math.h>
int main(void)
{
do
{
int f = round(get_float("Change owed: ") * 100);
}
while (f < 0)
q = ((f / 25)%)
d = ((q / 10)%)
n = ((d / 5)%)
c = (n%)
i = q + d + n + c
printf ("%i");
}
Can anyone please tell me how to fix my code? Thank you for your time and help!
As for variable f, isn't f declared in Cash 7:12?
Edit: I edited the code to declare the variables, a la below.
#include <cs50.h>
#include<math.h>
int main(void)
{
do
{
int f = round(get_float("Change owed: ") * 100);
}
while (f < 0)
int q = ((f / 25)%)
int d = ((q / 10)%)
int n = ((d / 5)%)
int c = (n%)
int i = q + d + n + c
printf ("%i");
}
Update: I fixed my code, as shown below, but nothing helped.
#include <cs50.h>
#include<math.h>
int main(void)
{
do
{
int f = round(get_float("Change owed: ") * 100);
}
while (f < 0)
int q = ((f / 25) %)
int d = ((q / 10) %)
int n = ((d / 5) %)
int c = (n %)
int i = q + d + n + c
printf("%i");
}
Update: The new semicolon didn't help.
#include <cs50.h>
#include<math.h>
int main(void)
{
do
{
int f = round(get_float("Change owed: ") * 100);
}
while (f < 0);
int q = ((f / 25) %)
int d = ((q / 10) %)
int n = ((d / 5) %)
int c = (n %)
int i = q + d + n + c
printf("%i");
}