M
Mohd Azhar Hussain
I am new to C. I was trying to read input from key board using scanf,
here's my program
int main(void)
{
int i,j;
scanf("hai");
scanf("%d\n",&i);
printf("i value %d\n",i);
scanf("%d",&j);
printf("j value %d\n",j);
return 0;
}
its printing i and j values both at a time(desired should print i
value first and j next).
I am using gcc 4.2 on linux .
what does scanf("hai") mean?
Is there any special meaning if i give '\n' in scanf?
here's my program
int main(void)
{
int i,j;
scanf("hai");
scanf("%d\n",&i);
printf("i value %d\n",i);
scanf("%d",&j);
printf("j value %d\n",j);
return 0;
}
its printing i and j values both at a time(desired should print i
value first and j next).
I am using gcc 4.2 on linux .
what does scanf("hai") mean?
Is there any special meaning if i give '\n' in scanf?