int ten = 10;
int two = 2,z=3;
printf(“Doing it right: “);
printf(“%d minus %d is %d \n”,ten,2,ten-two);
printf(“Doing it wrong: “);
printf(“%d minus %d is %d\n”,ten); // In this function i have not used the variable name “ten” then why it is not giving the error on compilation.
if “,” and name of variable are not declared then it also give output instead of error.
OUTPUT
Doing it right: 10 minus 2 is 8
Doing it wrong: 10 minus 2 is 8
if i use
printf(“%d minus %d is %d\n”,z);
then OUTPUT
Doing it wrong: 3 minus 2 is 8