2 votes 2 votes Kaluti asked Jan 14, 2018 Kaluti 593 views answer comment Share Follow See all 7 Comments See all 7 7 Comments reply Show 4 previous comments MiNiPanda commented Jan 14, 2018 reply Follow Share yes they do that is why print1() prints 20 in the 2nd case. But the implementation in the print2 is different. You are explicitly inserting 10 into x. So each time the print2 is getting invoked, the value of x=15 stays as it is until it encounters the line "x=10". 0 votes 0 votes MiNiPanda commented Jan 14, 2018 reply Follow Share Static variables are initialized only for once in it's lifetime. ref: https://www.geeksforgeeks.org/static-variables-in-c/ x=10 is not initialization. It is called definition. So this can be executed for more than once. initialization example: int x=10; definition example : x=10; declaration example : int x; ref: https://www.quora.com/What-is-the-difference-between-definition-and-initialization-in-C-language 0 votes 0 votes Kaluti commented Jan 14, 2018 reply Follow Share okk thanks 0 votes 0 votes Please log in or register to add a comment.