why the program showing runtime error ??

#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 :wink:

1 Like

ampersand(&) missing !!!

write like: scanf("%d",&i);

instead of

scanf("%d",i);