C Interview Questions and Answers

How do you know the size of a data type or variable?

The sizeof operator can measure the data type size.

What is type casting?

Converting one data type into another is known as type casting.

What is a function and advantages of it? 

A function is a block of set of instruction that perform specific task.
Advantages
Reusability: function can be reuse in different place to perform same task
Code reduction: repeated code can move into function and can call function in place 
Modularity: task can be simplify by dividing that in modularity, that also increase readability

When is the void keyword used in a function?

When declare functions with void then it will not require return a value.

What is Recursive Functions?

The function can be called by another function and can call itself from a statement inside the body of the function itself. When function called itself then is said to be recursive.

What is the purpose of main() function?

C program execution starts and ends with the main() function .
The main() function can returns an integer value to the environment that called the program. Where return 0; indicates program is terminated normally.

Can we compile a program without main() function?

Yes, we can compile program but it can't be executed.

What is the use of printf() and scanf() functions?

The printf() function is used for output and scanf() function is used for input.

What is the difference between the while and do-while statements?

The main difference is that in the while statement, the conditional expression is evaluated at the top of the loop, while in the do-while statement, the conditional expression is evaluated at the bottom of the loop. 
Therefore, do-while statement are guaranteed to be executed at least once even conditional expression will be fail.

What is the difference between break and continue statement?

break is a keyword used to terminate the loop or exit from the block. The control jumps to next statement after the loop or block.
continue is a keyword used for skipping the current iteration and go to next iteration of the loop.

What goto statement do?

The goto statement is to enable the programmer to jump unconditional from one spot to some other spot in the code. Uses of goto statement is not recommended because it can make program unreliable and hard to debug.

What Is a Pointer?

A pointer is a special variable that contains the memory address of another variable or function. 
Whereas address-of operator (&) can be used to obtain the address of a variable and   the asterisk (*) in a variable declaration tells the compiler that the declared variable is a pointer.

Latest Updates

Trigonometry

What is the value of cot 4π/3 ?

Indian Politics

Article-24 of the Indian Constitution ‘Prohibition of employment of children in factories, etc’ deals with?

Article-134A of the Indian Constitution ‘Certificate for appeal to the Supreme Court’ deals with?

Chemistry

Who invented Aspirin?

Physics

A larger force on a rotating body results in larger?

What is the unit of the physical quantity, magnetic flux density?

Algebra

The system of equations 2x + 4y = 6 and 4x + 8y = 8 is ?

Time and Distance

A thief is spotted by a policeman from a distacne of 100 m. When the policeman starts the chase, the thief also starts running. If the speed of the theif is 8 km / hour and that of the policeman is 10 km/hour, then how far will the theif have to run before he is overtaken?

Algebra

Aman and Alok attempted to solve a quadratic equation. Aman made a mistake in writing down the constant term and ended up in roots (4, 3). Alok made a mistake in writing down the coefficient of x to get roots (3, 2). The correct roots of the equation are?

Compound Interest

The effective annual rate of interest corresponding to a nominal rate of 22% per annum payable half-yearly is?

Volume and Surface Area

If the volume of a cylinder is 2156 cubic cm and height is 14 cm, find its radius?

Algebra

What is the equation of the line which passes through the points (2, 3) and (- 4, 1)?

Triangles

In △ABC, the angle bisector of ∠A cuts BC at E. Find length of AC, if lengths of AB, BE and EC are 9 cm, 3.6 cm and 2.4 cm?

In a triangle, the length of the opposite side of the angle which measures 45° is 8√2 cm, what is the length of the side opposite to the angle which measures 90°?

General Knowledge of India

The boundary line between India and Pakistan is called?

Which city is located on the banks of the river Mahanadi?

Indian History

When was the battle of Haldighati fought?

In 1498, which Portuguese explorer discovered a new sea route from Europe to India?

General Knowledge of India

Chapchar Kut is a festival of which State?

Chemistry

In chemistry, soap is a salt of a ?

Indian Economy

Which of the following is a Direct tax?

Biology

Sauria lacertidae is the scientific name of?

Which of the following is a primary function of haemoglobin?

Average

A factory buys 8 machines.3 Machine A, 2 Machine B and rest Machine C. Prices of the machines are 100000, 80000 and 45000 respectively.Calculate the average cost of these machines?

Discount

Ticket for an adult is 500 and a child is 200. 1 child goes free with two adults. If a group has 20 adults and 8 children what will be the discount the group get?