0
What should be the value of i and k at the end of the following program segments?
int i,j,k; { j=5; i=2*j/2; k=2*(j/2); }
18 Antworten
+ 3
BlazingMagpie This was the feature I was making fun of:
https://code.sololearn.com/cm2F6IW8r7kV/?ref=app
It was a play on scope: This i vs that i. PS: You were right about it not being uninitialized, scope works in hierarchy.
+ 1
We've been there an hour ago. OP wanted to get result on screen.
0
5 and 4
Do your homework yourself.
0
this program output is no output
0
why print command ,because i'm already value decleared
0
#include <stdio.h>
main()
{
int i,j,k;
j=5;
printf("%d %d",i,j);
i=2*j/2;
k=2*(j/2);
}
0
#include <stdio.h>
main()
{
int i,j,k;
j=5;
printf("%d %d",i,j);
i=2*j/2;
k=2*(j/2);
}
0
Put print at the end instead of the middle.
Before }
0
like that but output is wrong
0
nonzyro Nope, the variables don't return to uninitialised state. Just like in blocks after if statements and for loops you can set values outside said blocks and they won't reset back.
By the way, how do I tag someone?
- 1
this progrom is not out given