I have used this syntax for printing some variable n. I know that the syntax is wrong but was not able to understand what is happening behind the scenes. It is not even creating an error. Inside the main method:
int fac,p=1,n,i;
printf("Enter the value of n \n");
scanf("%d",&n);
printf("The factorial is \n %d"+n);
I have used +n
in last line and that is not the right syntax. Output is:
factorial is
1
can someone help me to figure out what is happening behind the scenes. How is compiler understanding that +n
in print function.
Aucun commentaire:
Enregistrer un commentaire