I mistakenly used scanf("%d\n",&val);
in one of my programmes, I could not understand the behavior, the function showed.
int main(){
int val;
scanf("%d\n", &val);
printf("%d\n", val);
return 0;
}
Now the program required 2 integer inputs, and prints the first input that was entered.
What difference should that extra \n
brings?
I tried to search but couldn't find the answer, even through manual of scanf
.