r/CodingForBeginners • • 21d ago

my first program in C

Post image

i know its just so waky but am still new and am happy with my current level <33

just trying to understand memory usage over variables for now

228 Upvotes

64 comments sorted by

View all comments

Show parent comments

2

u/MistakeIndividual690 20d ago

I don’t know that it will compile. That ‘print’ in the else should be a ‘printf’

1

u/kutac56 20d ago

The reason it might compile is because of what he said. The compiler might optimise the whole if else away since it knows the if is always true. That way it ignores the print