C Language INTERVIEW QUESTION & ANSWERS
46. |
What is a loop? |
|
A loop is a process to do a job repeatedly with possibly different data each time.
The statements executed each time constitute the loop body, and each pass is called iteration. A condition must be present to terminate the loop. |
|
Posted by Anil. (Dec 29, 2013) |
|
Loop is a iteration statements. |
47. |
What are the types of data types and explain? |
|
There are five basic Data types in C. These are : - void : means nothing i.e. no data involvement in an action
- char : to work with all types of characters used in computer operations
- int : to work with an integer type of data in any computational work
-
float : to work with the real type of data or scientific numbers in the exponential form
- double : to work with double precision of numbers when the approximation is very crucial.
|
48. |
What is friend function? |
|
The function declaration should be preceded by the keyword friend.The function definitions does not use either the keyword or the scope operator ::. The functions that are declared with the keyword friend as friend function.Thus, a friend function is an ordinary function or a member of another class. |
49. |
What is break statement? |
|
When a break is encountered inside a loop, the loop is terminated and the control
passes to the statement following the body of the loop. |
50. |
What is the use of getchar() function? |
|
It returns a character just entered from the standard input unit, that is, keyboard. The entered character can be either assigned to a character variable or echoed to the computer screen. |