2 votes 2 votes what will be the output: (a) 3 5 8 8 3 (b) 3 5 7 8 8 (c) compilation error Programming in C ace-test-series programming + – Prateek Raghuvanshi asked Oct 10, 2017 • edited Mar 7, 2019 by Rishi yadav Prateek Raghuvanshi 438 views answer comment Share Follow See all 5 Comments See all 5 5 Comments reply Show 2 previous comments joshi_nitish commented Oct 10, 2017 reply Follow Share @Prateek Raghuvanshi they are declared in different scope( { } ), so no problem....if they were declared in same scope than it would lead to redeclaration error at compile time. 1 votes 1 votes Rishabh Gupta 2 commented Oct 10, 2017 reply Follow Share All those are in different scope. 1 votes 1 votes Prateek Raghuvanshi commented Oct 10, 2017 reply Follow Share okk i got it now thank u 0 votes 0 votes Please log in or register to add a comment.
Best answer 4 votes 4 votes This question is based on the block scope of a variable. A variable declared in a block is accessible in the block and all inner blocks of that block but not accessible outside the block. Hence option a) is correct Ashwani Kumar 2 answered Oct 10, 2017 • selected Oct 10, 2017 by srestha Ashwani Kumar 2 comment Share Follow See all 0 reply Please log in or register to add a comment.
0 votes 0 votes Option a is correct because of scope Rishi yadav answered Oct 11, 2017 Rishi yadav comment Share Follow See all 0 reply Please log in or register to add a comment.