C Programing Interview Question Answe1
C Programing Interview Question Answe1
ANSWER
1) What is c language?
3. What do you mean by the Scope of the variable? What is the scope
of the variables in C?
Ans: Scope of the variable can be defined as the part of the code area where the
variables declared in the program can be accessed directly. In C, all identifiers are
lexically (or statically) scoped.
Ans: The variables and functions that are declared using the keyword Static are
considered as Static Variable and Static Functions. The variables declared using
Static keyword will have their scope restricted to the function in which they are
declared.
Ans: calloc() and malloc() are memory dynamic memory allocating functions. The
only difference between them is that calloc() will load all the assigned memory
locations with value 0 but malloc() will not.
6. What are the valid places where the programmer can apply Break
Control Statement?
Ans: Break Control statement is valid to be used inside a loop and Switch control
statements.
Ans: To store a negative integer, we need to follow the following steps. Calculate the
two’s complement of the same positive integer.
Ans: The Parameters which are sent from main function to the subdivided function
are called as Actual Parameters and the parameters which are declared a the
Subdivided function end are called as Formal Parameters.
Ans: The program will be compiled but will not be executed. To execute any C
program, main() is required.
Ans: When a data member of one structure is referred by the data member of
another function, then the structure is called a Nested Structure.
In case you are facing any challenges with these C Programming Interview
Questions, please write your problems in the comment section below.
Ans: C introduced many core concepts and data structures like arrays, lists,
functions, strings, etc. Many languages designed after C are designed on the basis
of C Language. Hence, it is considered as the mother of all languages.
No. “if” command can only be used to compare numerical values and single
character values. For comparing string values, there is another function called
strcmp that deals specifically with strings.
18) How do you determine the length of a string value that was stored
in a variable?
To get the length of a string value, use the function strlen(). For example, if
you have a variable named FullName, you can get the length of the stored
string value by using this statement: I = strlen(FullName); the variable I will
now have the character length of the string value.
Yes, you don’t have to write a separate assignment statement after the
variable declaration, unless you plan to change it later on. For example:
char planet[15] = “Earth”; does two things: it declares a string variable
named planet, then initializes it with the value “Earth”.
Reserved words are words that are part of the standard C language library.
This means that reserved words have special meaning and therefore
cannot be used for purposes other than what it is originally intended for.
Examples of reserved words are int, void, and return.
This is because, at any time, the values of the objects can be changed by code
outside the scope of the current code.
a=0;
while (a<=10) {
a++;
}
for (a=0; a<=10; a++)
It is used as a prefix to primary data type to indicate the storage space allocation’s
modification to a variable. The available modifiers are:
1. short
2. long
3. long long
4. signed
5. unsigned
Pointers is a concept available in C and C++. The variable ‘v’ might contain the
address of another memory or a value.
***********************************