Wednesday 23 September 2015

Frequently Asked C Programming Interview Questions and Answers

61) What is character constants?
A character constant is a single character, enclosed within the pair of single quotation mark (apostrophes).

62) What is string constants?
A string constant or literal contains a sequence of zero or more characters or escape seauences enclosed in double Quotation marks.

63) What is integer constants?
An integer constant is an integer-valued number. It can represent decimal, octal, or hexadecimal values.

64) What is floating point constants?
Floating-point constants are numbers with decimal parts. A floating-point constants consists of :
=> An integral part
=> A decimal point
=> A fractional part
=> An exponent part
=> An optional suffix

65) What is the difference between fread and fwrite function?
The fread() function returns the number of items read. This value may be less than count if the end of the file is reached or an error occurs. The fwrite() function returns the number of items written. This value will equal count unless an error occurs.

66)What are the uses of a pointer?
=> Pointer is used in the following cases
=> It is used to access array elements
=> It is used for dynamic memory allocation
=> It is used in Call by reference
=> It is used in data structures like trees, graph, linked list etc.

67) What are linker error?
The Linker Errors occur during the linking process when the external symbols referred to by the program are not resolved.

68) What are runtime error?
The Runtime Errors occur while a program is being run and hence the name. They occur due to both program internal and external factors.

69) When do we get logical errors?
=> The Logical Errors occur if the solution procedure for the given problem itself is wrong.
=> In this case, the outputs produced by the programs would be incorrect.
=> Correcting the solution procedure itself by better understanding of the problem eliminates these errors.
=> The Logical Errors (if any) are to be figured out by ourselves by verifying the outputs that are produced by the program.

70) Do character constants represent numerical values?
Yes, each character constant associates an integer value with it.

More Questions & Answers:-

No comments:

Post a Comment