Can anyone please explain me the following:
1. First Example:
int i = get_int ("Integer:");
printf ("hello,%i"\n", i);
In this example near the %
operator we use the declared variable "i
".
The "i
" variable stores data and prints the stored data instead of "%i
".
1. Second Example:
int x = get_int("x: ");
int y = get_int("y: ");
printf("%i plus %i is %i\n", x, y, x+y );
Here @ 47: 05, near the %
sign, we also use a variable, but it is not declared:
In this example declared only 2 variables x
and y
, but not "i
".
But near the %
operator we use not declared variable "i
".
Why we are not using here the declared variables x
and y
, as in the first example?
- Can we use near the
%
operator only declared variables? - If yes, why we are using in the second example something, that is not declared previously ?
Thank you in advance