Explain about block scope in c?



Explain about block scope in c?..

Answer / Rupesh Kumar Pandey

In C, the block scope refers to variables that are declared within curly braces `{}`. These variables exist and can be accessed only within the blocks they are defined. They are initialized each time the block is entered and destroyed when the control leaves the block.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

There are N egg baskets and the number of eggs in each basket is a known quantity. Two players take turns to remove these eggs from the baskets. On each turn, a player must remove at least one egg, and may remove any number of eggs provided they all belong to the same basket. The player picking the last egg(s) wins the game. If you are allowed to decide who is going to start first, what mathematical function would you use to decide so that you end up on the winning side?

1 Answers   Hathway,


main() { int l=6; switch(l) { default:l=l+2; case 4:l=4; case 5:l++; break; } printf("%d",l); }

1 Answers  


write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.

1 Answers   HCL,


how can you print&scan anything using just one character? :) HINT: printf,scanf similer

2 Answers  


The statement, int(*x[]) () what does in indicate?

1 Answers  


What is pointer & why it is used?

1 Answers  


can i know the source code for reversing a linked list with out using a temporary variable?

6 Answers   Honeywell,


How the C program can be compiled?

11 Answers   HP,


what will be the output: main(){char ch;int a=10;printf("%d",ch);}

36 Answers   Accenture, TCS, Wipro,


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

0 Answers  


What is difference between && and & in c?

1 Answers  


write a programme to convert temperature from farenheit to celcius?

4 Answers   IBM,


Categories