What is scope rule of function in c?



What is scope rule of function in c?..

Answer / Satendra Singh

"The scope rule of a function in C defines where a variable can be accessed. If a variable is declared inside a function, it has local scope and can only be accessed within that function. Variables declared outside functions have global scope and can be accessed from any function."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

Describe the order of precedence with regards to operators in C.

1 Answers  


Find Index of least significant bit set in an Integer. ex. int value is say 10001000 results should be 4.

1 Answers  


what is diffrence between linear and binary search in array respect to operators?what kind of operator can be used in both seach methods?

1 Answers  


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

2 Answers   Cap Gemini, HCL,


How can you access memory located at a certain address?

1 Answers  


show how link list can be used to repersent the following polynomial i) 5x+2

1 Answers   CBSE,


#include<stdio.h> main() { int a[3]; int *I; a[0]=100;a[1]=200;a[2]=300; I=a; Printf(“%d\n”, ++*I); Printf(“%d\n”, *++I); Printf(“%d\n”, (*I)--); Printf(“%d\n”, *I); } what is the o/p a. 101,200,200,199 b. 200,201,201,100 c. 101,200,199,199 d. 200,300,200,100

1 Answers  


When c language was developed?

1 Answers  


#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }

7 Answers   HCL,


how to construct a simulator keeping the logical boolean gates in c

1 Answers  


Write a program that accepts a string where multiple spaces are given in between the words. Print the string ignoring the multiple spaces. Example: Input: “ We Are Student “ Output: "We Are Student"

1 Answers  


What has to put when we are inserting as assembly language code into the C code? or When we are inserting as assembly language code into the C code we have to insert one thing at the start and of the assembly language. What are they?

2 Answers  


Categories