2 votes 2 votes int i = 0 ; main( ) { printf ( "\nmain's i = %d", i ) ; i++ ; val( ) ; printf ( "\nmain's i = %d", i ) ; val( ) ; } val( ) { i = 100 ; printf ( "\nval's i = %d", i ) ; i++ ; } Programming in C programming-in-c output programming + – Parshu gate asked Nov 12, 2017 Parshu gate 493 views answer comment Share Follow See 1 comment See all 1 1 comment reply Anu007 commented Nov 12, 2017 i edited by Shivam Chauhan Nov 12, 2017 reply Follow Share 0,100,101,100 2 votes 2 votes Please log in or register to add a comment.
Best answer 2 votes 2 votes .... Hira Thakur answered Nov 13, 2017 selected Nov 13, 2017 by Parshu gate Hira Thakur comment Share Follow See 1 comment See all 1 1 comment reply Nitika Gupta commented Nov 14, 2017 reply Follow Share But this is call by value not call by address ,so i think answer should be 0,100,1,101 0 votes 0 votes Please log in or register to add a comment.
0 votes 0 votes ans i m getting as : 0 100 1 101 int i = 0 ;// i initialized to 0 and it is global main( ) { printf ( "\nmain's i = %d", i ) ;// prints global i hence prints 0 i++ ;// global i changes from 0 to 1 val( ) ;// prints 100 printf ( "\nmain's i = %d", i ) ;//prints global i hence prints 1 val( ) ;//again prints 100 } val( ) { i = 100 ;//as it is auto variable hence every time code starts executing from here printf ( "\nval's i = %d", i ) ; i++ ; } debasree88 answered Apr 23, 2019 debasree88 comment Share Follow See all 0 reply Please log in or register to add a comment.