0

What's the output of this and how it's come

#include <stdio.h> void fun(int* i, int* j){ *i=*i**i; *j=*j**j; } int main() { int i=2,j=3; fun(&i,&i); printf("%d,%d",i,j); return 0; }

28th Aug 2020, 10:44 AM
Ayesha
3 odpowiedzi
0
The ouput of the code is i = 4, j = 9 fun(&i,&j) -> means you are sending the address of i and j in the function fun(int* i, int* j) you're pointing to the address of i and j so every operation you will do it will be saved in the main i and j and you don't need the return in the function finally for the operation you only raised the number to its power like: n to the power of n.
9th Dec 2020, 7:12 PM
Sultan
Sultan - avatar
0
Ok we are sending (&i,&i) both same address not &j
12th Dec 2020, 5:14 AM
Ayesha
0
Can even more explain confuseing
12th Dec 2020, 5:15 AM
Ayesha