1000+ C Programming Coding Questions and Answers - 1

Question: 1

How global variables are declared?

Global variables are accessed in the functions of a program stored in one file. If the global variables have to be accessed by the functions in a file other than the one in which they are declared, the extern storage class can be used. The extern variables have global scope and the lifetime is throughout the execution of a program.

Question: 2

What is the difference between for loop and while loop?

The for loop is a definite repetition loop where we know in advance exactly how many times the loop will be executed. The while loop is preferred when the number of repetitions is not known before the loop begins executing.

Question: 3

What is local variable?

Local variables are the variables those are declared, defined and used within a function.

Question: 4

What is storage class?

Storage class is one of the attributes that is associated with the variable. C provides four storage classes. They are

Auto

Static

Register

Extern

Question: 5

What is walkthrough?

When a pseudo code or flow chart for an algorithm is given a method of checking the way in which a computer will work using this is called a walkthrough.

Related Questions