what is wrong in this

#include<stdio.h>

int main()
{
int a=0;
for(;a!=42;printf("%d",a))
{scanf("%d",&a);
if(a==42)
break;}
return(0);

you forgot new line

change printf("%d",a) to printf("%d\n",a)

3 Likes