what does this print?

Apr 23, 2022 at 1:06am
1)
int fun(int p);
void main()
{
int x = 3, y[10] = {1,2,3};
y[1] = fun(x);
printf("%d %d", x,y[1]);
}
int fun (int p)
{
p = 1;
return 1;
}
Apr 23, 2022 at 1:42am
What do you think is displayed?

This is YOUR test, not ours.
Apr 23, 2022 at 1:42am
sry
Apr 23, 2022 at 1:43am
its not duplicated, read the end they r different
Apr 23, 2022 at 7:00am
You learn by trying. If there are parts of the program that you do not understand look them up, or ask about them here. The program starts on the first line in main() so I suggest starting there, make sure you understand what each line is doing, and keep track of what the output is.
Last edited on Apr 23, 2022 at 7:02am
Apr 23, 2022 at 11:11am
what does this print


Put the code into a file (or use an IDE), compile it, run it and see what is displayed. Then if you don't understand, use the debugger to trace through the code to see what is happening, and then if you don't understand a particular line, then ask.
Topic archived. No new replies allowed.