C Language Interview Questions and Answers for Experienced - 7

Question: 31

What is an Array?

An array is a group of similar data types stored under a common name.

Int a[10]; Here  a[10] is an array with  10 integer  values.

Question: 32

What is the difference between ++a and a++?

       ++a Means do the increment before the operation (pre increment)

        a++  Means do the increment after the  operation(post increment)

Example:  a=5;

                   x=a++;              /*  assign  x=5 */

                   y=a;                 /*now  y assigns  y=6 */

                  x=++a;             /*assigns  x=7 */

Question: 33

How many bytes are occupied by the int, char, float, long int and double?

Int

Char

Float

Long int

Double               

2  bytes

1 bytes

4 bytes

4 bytes

8 bytes

 

Question: 34

What is the difference between while and do while loops in C?

While loop is executed only when given condition is true.

Whereas, do while loop is executed for first time irrespective of the condition.

After executing while loop for first time, then condition is checked.

 

Question: 35

Which functions in C can be used to append a string to another string?

The strcat function. It takes two parameters, the source string and the string value to be appended to the source string.

Related Questions