+ 3
Can you please explain the code and tell me the output. Actually when I tried to compile the code it shows error.
#include <iostream> using namespace std; int f(int k) {k++; return k;} int main() { int K{2}; k++; f(k); cout <<k; } this question is coming in c++ challenges
5 Respuestas
+ 13
@ Tamil
int k {2};
k++ // now value of k is 3
f (k)
cout <<k // prints 3 bcos the value of f (k) not assigned to any variable
sorry i don't see that "explain"
+ 12
you used capital k at main ()
+ 12
value assigning to k
+ 4
thank you @khadeeja
+ 4
plz explain the code to me. what is the meaning of k{3}