#include<stdio.h>
int main()
{
int i;
scanf("%d",i);
while(i != 42)
{
printf("%d",i);
scanf("%d",&i);
}
return (0);
}
There is missing & in first scanf…
I recommend using -Wall for gcc 
2 Likes
ampersand(&) missing !!!
write like: scanf("%d",&i);
instead of
scanf("%d",i);