ORAL QUESTION FOR SUBJECT C PROGRAMMING
1. What is variable?
Ans :: A variable is a name of the memory location. It is used to store data. Its value can be changed, and it can be reused many times.
2. What is constant?
Ans:: A constant is a name given to the variable whose values can't be altered or changed
3. How many bytes are required to store integer type value?
Ans:: 4
4. How many bytes are required to store float type value?
ans:: 4
5. How many bytes are required to store char type value?
Ans:: 1
6. How many bytes are required to store
double type value?
Ans:: 8
7. What is main difference between variable and constant?
Ans :: A constant does not change its value over time. A variable, on the other hand, changes its value dependent on the equation.
8. What is logical variable?
Ans:: Logical Variables are simply placeholders for values which are not yet known, like in mathematics
9. What is global variable?
Ans:: The variables that are declared outside the given function are known as global variables.
10. How long is word?
Ans:: 4 bytes
11. How long is a byte?
Ans:: 8 bytes
12. How does a programmer finds coding errors?
Ans:: Test the program on simple cases for which the result of the program is known. Break down the program into a sequence of basic steps and independently test each component.
13. Describe the appearance of machine code?
Ans::
14. Whether the program in c can be executed by computer directly?
Ans:: NO
15. What is language processor?
Ans: Language processor may refer to: Natural language processor, a computer programmed to process human (natural) languages. Programming language processor, a computer program which translates a source program written in one programming language to another.
16. What is purpose of language processor?
Ans:A language processor is a software program designed or used to perform tasks such as processing program code to machine code.
17. What are major disadvantages of machine code?
Ans:: It is machine dependent i.e. it differs from computer to computer. It is difficult to program and write. It is prone to errors ,It is difficult to modify.
18. Give the general syntax of conditional operator?
Ans:: The conditional (ternary) operator is the only JavaScript operator that takes three operands: a condition followed by a question mark ( ? ), then an expression to execute if the condition is truthy followed by a colon ( : ), and finally the expression to execute if the condition is falsy
19. Which are relational operator?
Ans :: A relational operator checks the relationship between two operands. If the relation is true, it returns 1; if the relation is false, it returns value 0. Relational operators are used in decision making and loops.
Examples == < != > etc
20. Which are logical Operators?
Ans: An expression containing logical operator returns either 0 or 1 depending upon whether expression results true or false. Logical operators are commonly used in decision making in C programming.
Example: && || !
21. Which are Bitwise Operators?
Ans: Bitwise operators are used in C programming to perform bit-level operations.
EXample: & | ^ << >>
22. Which are unformatted input output functions?
Ans:: getch(), getche(), getchar(), gets(), puts(), putchar() etc. are examples of unformatted input output functions.
23. Which are formatted input output functions?
Ans:: printf() and scanf() are examples for formatted input and output functions.
24. What is the use of getchar() function?
Ans:: getchar is a function in C programming language that reads a single character from the standard input stream stdin, regardless of what it is, and returns it to the program. It is specified in ANSI-C and is the most basic input function in C
25. What is the use of getch() function?
Ans:: getch() method pauses the Output Console until a key is pressed.
26. What is the use of getch() function?
Ans: getch() is a way to get a user inputted character. It can be used to hold program execution
27. What is Disk IO Function?
Ans :: Disk I/O includes read or write or input/output operations (defined in KB/s) involving a physical disk
28. What do you mean by console IO
functions
Ans:: These functions allow us to receive input from the input devices like keyboard and provide output to the output devices like the Visual Display Unit
29. Give syntax of simple if statement
Ans: if (condition) instruction;
30. Give syntax of simple if – else statement
Ans::
if(condition) {
// Statements inside body of if
}
else {
//Statements inside body of else
}
31. Give syntax of simple nested if – else
statement?
Ans ::
if(condition) {
//Nested if else inside the body of "if"
if(condition2) {
//Statements inside the body of nested "if"
}
else {
//Statements inside the body of nested "else"
}
}
else {
//Statements inside the body of "else"
}
32. Define Program
Ans:; program is a set of instructions that a computer uses to perform a specific function
33. What is nested loop?
Ans:: A nested loop is a loop within a loop, an inner loop within the body of an outer one.
34. What is process loop?
Ans: the first pass of the outer loop triggers the inner loop, which executes to completion. Then the second pass of the outer loop triggers the inner loop again. This repeats until the outer loop finishes.
35. What is Syntax Error?
Ans:: Syntax errors are mistakes in the source code, such as spelling and punctuation errors, incorrect labels, and so on, which cause an error message to be generated by the compiler.
36. What is Logical Error?
Ans:: On compilation and execution of a program, desired output is not obtained when certain input values are given. These types of errors which provide incorrect output but appears to be error free are called logical errors
37. What is Run Time Error?
Ans:: A runtime error occurs when a program is syntactically correct but contains an issue that is only detected during program execution
38. Define Array
Ans:: Array in C can be defined as a method of clubbing multiple entities of similar type into a larger group.
39. Give general Syntax to declare One dimensional array
Ans::
datatype array_name[size];
40. Give general Syntax to declare two dimensional array
Ans:: data_type array_name[rows][columns];
41. What is function?
Ans:: A function is a block of code which only runs when it is called.
42. What is built in function?
Ans:: Built-in(Library) Functions. The system provided these functions and stored them in the library. Therefore it is also called Library Functions. e.g. scanf(), printf(), strcpy, strlwr, strcmp, strlen, strcat etc.
43. What is use of return statement?
Ans:: A return statement ends the execution of a function, and returns control to the calling function.
44. What is the use of strcat() function?
Ans:: The strcat() function concatenates string2 to string1 and ends the resulting string with the null character.
45. What is the use of strcmp() function?
Ans:: strcmp compares two character strings ( str1 and str2 ) using the standard EBCDIC collating sequence.
46. What is the use of strrev() function?
Ans: This function is used for reversing a string. The reversed string is stored in the same string
47. What is the use of strlen() function?
Ans: The strlen() function determines the length of string excluding the ending null character.
48. What is the use of strcpy() function?
Ans:: The strcpy() function copies string2, including the ending null character, to the location that is specified by string1.
49. What is recursive function?
Ans;; a recursive function can be defined as a routine that calls itself directly or indirectly
50. What do you mean by call by value?
Ans:: The call by value method of passing arguments to a function copies the actual value of an argument into the formal parameter of the function. In this case, changes made to the parameter inside the function have no effect on the argument. By default, C programming uses call by value to pass arguments.
51. What do you mean by call by reference?
Ans:: The call by reference method of passing arguments to a function copies the address of an argument into the formal parameter. Inside the function, the address is used to access the actual argument used in the call. It means the changes made to the parameter affect the passed argument.
52. What is pointer?
Ans:: The Pointer in C, is a variable that stores address of another variable.
53. What is structure?
Ans: A structure is a key word that create user defined data type in C
54. What is main difference between structure and union?
Ans :: The major difference between a structure and a union is storage. In a structure, each member has its distinct storage location while the members of a union utilize a shared memory location that is equal to the size of its largest data member
55. What is use of typedef?
Ans:typedef is a reserved keyword in the programming languages C and C++. It is used to create an additional name (alias) for another data type, but does not create a new type, except in the obscure case of a qualified typedef of an array type where the typedef qualifiers are transferred to the array element type.
56. Whether Structured programming helps in reducing errors?
Ans:: Yes and it is easier to understand and user friendly
57. What is preprocessor?
Ans: A Preprocessor Directive is considered as a built-in predefined function or macro that acts as a directive to the compiler and it gets executed before the actual C Program is executed