+3

why output is 89????? why why why why why ........

//---what is output #include<stdio.h> int i=10; void g() { i=89; printf("in g %d\n",i); } int main() { printf("%d\n",i); i=1; printf("%d\n",i); g(); printf("%d",i); return 0; }

5/18/2020 5:47:12 AM

Ashutosh k.

10 Answers

New Answer

+3

Answer Try to understood how its working . Its not tricky very simple 10 1 in g 89 89

+2

Ashutosh k. 1 why is enough frnd 😂😂😂 6 whys (maybe incorrect) need 6 questions

+2

Ashutosh k. Avinesh It's the output 10 1 in g 89 89

+2

yes why 89 answer, function having void na avinesh

+2

Here i is a global variable so it could be accessed and altered anywhere within this file. In void g() you assign i=89 so that is it's final value. If you access it anywhere, it will return the same.

+2

Thanks avinesh

+2

Thanks to all my friends, your efforts make me a good to great programer.

+1

hello bro , i m totally frasted, that's why i put

+1

help me if u can

+1

Ashutosh k. How do you get the output 9?