1000+ C Questions and Answers Pdf - 1

Question: 1

How will you declare pointer variable?

A pointer variable is declared as

int*y;

The above declaration is a pointer variable declaration. Here, y is a pointer variable whose type is an integer pointer (int *).

Question: 2

What is the difference between an array and a structure?

Array

1. An array is a collection of elements of same data type.

2. An array is a homogeneous collection. Structure.

Structure

1. A structure is a collection of elements of different data types.

2. A structure is a heterogeneous collection of elements.

Question: 3

Which data type is suitable to store real value?

To store the real (float) values the type double is used. It occupies 8 bytes in the memory.

Question: 4

What is stack?

A stack is a last in first out (LIFO) structure. In C language, when a function is invoked, its parameters are stored onto a stack from right to left.

Question: 5

What is the memory allocation of primary data type?

An integer requires 2 bytes of memory to store its value, a float requires 4 bytes of memory and a character requires 1 bytes of memory.

Related Questions