1 1 vote print 1-----> print 15 and print 2 ------>print 15 ? given ans is 15 20 why 20? Programming in C + – mohitbawankar 1.6k views answer comment Share Follow Print See all 13 Comments 13 13 Comments reply Show 10 previous comments hs_yadav commented Jan 6, 2018 reply Follow flag @shivanisrivarshini At print 2 ,even staic int x is initialized to 10 but x is already intialied before so x value remains same as 15 and then incremented by 5 so now x value is 20 i think u r missing something.... 1. initialization of static is not restricted to only one time.... 2. one other thing to notice here is variable x of F1..would be accessible only in F1 and of F2 would be in only F2 ..even these are deallocating at the end of whole programm but these could not accessed from out if it's scope..... and i also think ...answer is going to be ...15 15 ....evry varible would be treated as seprate variable https://ide.geeksforgeeks.org/gKL0gTlcE5 2 2 replyShare shivanisrivarshini commented Jan 6, 2018 reply Follow flag Yup ur right a missed a point Thank u 0 0 replyShare mohitbawankar commented Jan 6, 2018 reply Follow flag final conclusion 15 15 is right ? 1 1 replyShare Please log in or register to add a comment.