TEST help.

I wrote the following program for the problem “TEST” , then I submitted it in BASH language… it gave a runtime error, but it works perfectly on my system … can anyone help me figure out what’s the problem??

touch x.c
printf ‘%s’ ’

#include <stdio.h>
int main(){

int n;
scanf("%d",&n);
while(n!=42){
printf("%d\n",n);
scanf("%d",&n);
}

return 0;
}

’ > x.c

gcc x.c
./a.out

Instead of running the program on your computer, ope Ideone. Choose the language Bash there and then check whether your program is correct or not.

1 Like