InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
How do you represent increment operator? |
|
Answer» Represent increment operator by a++ or ++a. |
|
| 52. |
What is the meaning of the symbol ”~”? |
|
Answer» The meaning of the symbol ”~” is 1’s complement operator. |
|
| 53. |
What is the value of 17%-2? |
|
Answer» The value of 17%-2 is +1. |
|
| 54. |
Briefly explain logical error. |
|
Answer» As the name implies Logical errors are related to the logic of the program execution. Logical errors do not show compiler generated error messages rather they cause wrong results. These errors are primarily due to poor understanding the problem, incorrect translation of the algorithm into program and lack of clarity of hierarchy of operators. In the statement if(x= =y) printf(“They are equal\n”); when x and y are float type, they rarely become equal due to truncation errors. The printf may not be executed at all. Similarly test condition while(x!=y) might create an infinite loop. |
|
| 55. |
How do you represent logical AND, OR and NOT operators? |
|
Answer» Logical AND is represented as &&, Logical OR as || and NOT as! |
|
| 56. |
What is a relational operator? |
|
Answer» Relational operator is used to compare two operands in an expression. |
|
| 57. |
Write any four arithmetic operators and their meaning. |
|
Answer» (i) + addition or unary plus, (ii) - subtraction or unary minus, (iii) * multiplication, (iv) / division, (v) % modulo division. |
|
| 58. |
What is testing a program? |
|
Answer» The process of executing the program to test the correctness of the results is testing. |
|
| 59. |
Briefly explain run time error. |
|
Answer» When the user tries to run ambiguous instructions run time error occurs. Errors of mismatching the data types, referencing out of range array element cannot be detected by the compiler. Divide by zero, data overflow are some examples. |
|
| 60. |
What is run time error? |
|
Answer» Run time errors occur when the user tries to run ambiguous instructions. |
|
| 61. |
What are the different types of errors a programmer do? |
|
Answer» Generally, programmers do three types of errors namely syntax error, logical error and run time error. |
|
| 62. |
Briefly explain how to write a C program. |
|
Answer» In writing a C program one style should be used and there should be consistency. Lower case letters are used to write a program. Group program statements are written together. Braces used to mark the beginning and end of the function. C is free from language, one can group statements together on same line. However, this make the program more difficult to understand. |
|
| 63. |
Write the different constants used in a C program. |
|
Answer» The constants used in C are broadly divided as numeric and non numeric constants. Numeric is further divided as integer and float point constant, while non numeric is divided as character and string constants. |
|
| 64. |
Where does the program be executed in a Computer? |
|
Answer» Program is executed in the central processing unit(CPU). |
|
| 65. |
Mention the different relational operators and their meaning. |
||||||||||||||
Answer»
|
|||||||||||||||
| 66. |
What are constants? |
|
Answer» The quantity which does not change during the execution of a program is a constant. |
|
| 67. |
Mention the different types of run time errors. |
|
Answer» The run time errors are infinite loop in a program, divide by zero, null pointer assignment, data overflow. |
|
| 68. |
What is a floating constant? Give an example. |
|
Answer» Floating constant is a number with a decimal point. It is a sequence of digits preceded and followed by a decimal point. General form of floating constant is sign integer part decimal point fractional part. Example is 28.75, -0.00002345, 0.123e5. |
|
| 69. |
What are C tokens? |
|
Answer» The basic and smallest units of a C program are C tokens.(keywords, constants, operators etc) |
|
| 70. |
Mention the different C tokens. |
|
Answer» Keywords, identifiers, constants, strings, operators and special symbols are the different C tokens. |
|
| 71. |
Write the general format of ‘scanf( )’ formatted input. |
|
Answer» General format of scanf( ) formatted input is scanf(“control string”, address list). |
|
| 72. |
Which are the input and output functions used in C? |
|
Answer» To perform input-output operations C provides a library functions. This is called standard input-output library. It is denoted as stdio. Header file containing such library functions is stdio.h. scanf( ), printf( ), getchar( ), putchar( ), gets( ), puts( ), getch( ),getche ( ) are the standard functions in C performing i/o operations. |
|
| 73. |
Mention the different character groups and their meaning. |
||||||||||||||||||||||||
Answer»
|
|||||||||||||||||||||||||
| 74. |
Write the formatted and unformatted i/o functions in C. |
|
Answer» Function scanf( ) is used to read the values for the variables in C from the keyboard. The scanf( ) is used to enter the numeric, character and string type data. It is included in the header file <stdio.h>. C programming provides printf( ) function to display the data on the output device(monitor). Syntax for scanf( ) and printf( ) is printf(“control string”, variable); scanf(“control string”, address_list); |
|