Sorry to ask such a noob question but, in Life, the Universe, and Everything using C.
#include<stdio.h>
int main()
{
int howmuch;
` while (howmuch != 42)
{
scanf("%d", &howmuch);
printf("%d\n", howmuch);
}
return 0;
}
Surely as long as I scan first then print it should be correct? I even scanned before the loop. Nothing worked until I scanned before the loop, printed in the loop then scanned again.
Just wondering why this code doesn’t work, again I’m quite new to all this.
Thanks,