why my solution is not working???

#include<stdio.h>
#include<conio.h>
void main()
{
int n;
scanf("%d",&n);
while(n!=42)
{printf("/n%d",n);
scanf("%d",&n);
}
getch();
}

Remove the “getch()” as it will cause the program to wait for a non-existent input.
Also, change the printf("/n%d") to printf("%d\n") because the first one will print ‘/n’ followed by a number instead of a number followed by a new line.

1 Like