Wednesday, 23 September 2015

Latest C Programming Interview Questions and Answers

41) What is the difference between single charater constant and string constant?
=> A single character constant consists of only one character and it is enclosed within a pair of single quotes.
=> A string constant consists of one or more characters and it is enclosed within a pair of double quotes.

42) What is signed and unsigned?
A numeric value, may have a positive or a negative sign. In the memory, for a variable, one bit is used exclusively to maintain the sign of the data. If we don't have sign, the sign bit also may be used for data. If the value is negative, the sign bit is 1, and if it is positive, it will be 0.

43) What are the different categories of functions in C?
=> In C, the functions can be divided into the following categories :
=> Functions with no arguments and no return values
=> Functions having arguments but no return values
=> Functions having arguments and return values also

44) What is this pointer?
It is a pointer that points to the current object. This can be used to access the members of the current object with the help of the arrow operator

45) What is zero based addressing?
The array subscripts always start at zero. The compiler makes use of subscript values to identify the elements in the array. Since subscripts start at 0, it is said that array uses zerobased addressing.

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.

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.

More Questions & Answers:-

No comments:

Post a Comment