T
Tweaxor
Hey, forgive me of my ignorance!
Can someone tell me why this won't work. I have this coded but it
won't compile is this not permitted in C.
kg = kilograms and d = distance // this is not code but a example of
what
I was trying to do. I at the library now and I don't have the code
with me now
but this is what I was trying to do.
if kg => 6kg
if d => 200
count = 1.50
else for (d; d > 200; d--)
count + 1.50
Well that basically how I coded it. I was trying to see if the
distance is 200 or less if so add 1.50 to count. But if it's more
than 200 add 1.50 to count for every 200 in distance. Using a for loop
that how I thought it should be written. The Sams teach yourself
don't mention when one should use different looping statements.
Please explain to me why this would work. I got it to work using only
if statements thou. Explain plz. Thanks in advance
Can someone tell me why this won't work. I have this coded but it
won't compile is this not permitted in C.
kg = kilograms and d = distance // this is not code but a example of
what
I was trying to do. I at the library now and I don't have the code
with me now
but this is what I was trying to do.
if kg => 6kg
if d => 200
count = 1.50
else for (d; d > 200; d--)
count + 1.50
Well that basically how I coded it. I was trying to see if the
distance is 200 or less if so add 1.50 to count. But if it's more
than 200 add 1.50 to count for every 200 in distance. Using a for loop
that how I thought it should be written. The Sams teach yourself
don't mention when one should use different looping statements.
Please explain to me why this would work. I got it to work using only
if statements thou. Explain plz. Thanks in advance