Friday, 7 February 2014

C Interview Questions and Answers - 4

See the Complete C tutorial Here

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 sequences 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.

71) What is the purpose of scanf() and printf() functions?
The function scanf() is used for formatted input from the standard input and provides many of the conversion facilities.
It is used for formatted output to standard output device, that is, screen. The format specification string and the data to be output, are the arguments (parameters) to the printf() function.

72) What is type qualifiers?

Type qualifier adds properties to an identifier. Type qualifiers describe the manner in which the object will be modified. The application of qualifiers to an object does not affect the range or the arithmetic properties of the object.

73) What are the types of type qualifiers in c?
The two type qualifiers provided by C are :

74) What is meant by inheritance?

Inheritance is the process by which objects of one class acquire properties of objects of another class..

75) Do string constants represent numerical values?

No, the string constants donot have a corresponding numerical value.

76) What is meant by operator precedence?

Operator precedence describes the order in which C evaluates different operators in a complex expression.

77) What is an Operator?

An operator is a symbol, which instructs the computer to perform the specified manipulation over some data. The rich set of operators available in C enable us to write efficient and concise programs and this fact serves to set C apart from any other programming languages.

78) What are the types of operators in c?
Assignment operator
Arithmetic operators
Relational operators
Logical operators
Increment/Decrement operators
Shorthand arithmetic assignment operators
Conditional operator
Bitwise operators
Sizeof() operator
Comma operator

79) What is a ternary operator in C?

Perhaps the most unusual operator in C language is one called the conditional expression operator. Unlike all other operators in C which are either unary or binary operators the conditional expression operator is a ternary operator; that is, it takes three operands. The two symbols that are used to denote this operator are the question mark (?) and the colon (:). The first operand is placed before the ?, the second between the ? and the and the third after the :

80) What is assignment operator?

An operator is a symbol that operates on a certain data type.In C, the ’=’ symbol is known as the assignment operator. It sots the value of the variable on the left hand side of it to that of the right hand side of it.

1  2  3  4  5

See the Complete C tutorial Here

Get Ebooks delivered to your email id


Subscribe to our channel


Powered by Blogger.

Home | Contact Us | DMCA | Terms of Service | Privacy | Advertise

Maven Scientists