1. What is the primary goal of Top-Down Design?
A . To write the entire program in one function.
B . To start coding immediately without planning.
C . To break a complex problem into smaller, more manageable subproblems.
D . To focus on optimizing the code for speed from the beginning.
2. A Structure Chart in top-down design is used to:
A . Display the values of variables during execution.
B . Show the hierarchical relationship between program modules (functions).
C . List all the library functions used in the program.
D . Draw the flow of data in memory.
3. Which of the following is a valid example of a standard Library Function?
A . calculateAverage()
B . my_print()
C . scanf()
D . getUserInput()
4. A function that performs a task but does not return a value should be declared with what return type?
A . int
B . double
C . char
D . void
5. The & operator in C, when used with a variable, is known as the:
A . Indirection operator
B . Address-of operator
C . Multiplication operator
D . Value-of operator
6. What is the purpose of an input argument to a function?
A . To allow the function to modify the original argument`s value.
B . To send a value from the caller into the function for processing.
C . To return multiple values from the function.
D . To point to a memory location.
7. Consider the code: int y = 5; int *ptr = &y;. What is the value of *ptr?
A . The memory address of y
B . The value 5
C . The memory address of ptr
D . An undefined value
8. What is the key characteristic of a function with an output parameter?
A . It uses a return statement to send back a value.
B . It takes one or more arguments as pointers, allowing it to modify the variables in the caller`s scope.
C . It can only be called once from the main function.
D . It does not accept any arguments.
9. In the function call swap(&num1, &num2);, what is the purpose of the & operator?
A . It performs a logical AND operation.
B . It dereferences the pointers num1 and num2.
C . It passes the addresses of num1 and num2 so the swap function can modify them.
D . It ensures the values of num1 and num2 are not changed.
10. The scope of a local variable declared inside a function is:
A . The entire program.
B . Only from the point of declaration to the end of that function`s block.
C . Only inside the main function.
D . Global and can be accessed by any function.
11. Which of the following function prototypes correctly defines a function with an output parameter for an integer?
A . void process(int data);
B . int process(int *data);
C . void process(int *data);
D . void process(int &data);
12. When a function with an output parameter is called multiple times, what happens?
A . The function`s code is duplicated for each call.
B . The same function code is executed, but it can manipulate different memory locations each time it is called.
C . It can only be used with global variables.
D . It becomes an inline function automatically.
13. What is a potential risk of using an uninitialized pointer?
A . It will always point to zero.
B . It may cause a segmentation fault or access unintended memory locations.
C . It automatically initializes to NULL.
D . The program will compile but run slowly.
14. Why is it generally considered bad practice to use global variables extensively to share data between functions?
A . They make the program faster.
B . They improve the modularity and reusability of functions.
C . They can lead to code that is difficult to debug and maintain because any function can change them.
D . They have a very limited scope.
15. In top-down design, what is the relationship between a function`s "caller" and "called" function as shown in a structure chart?
A . The called function is a parent of the caller.
B . The caller is a subordinate module to the called function.
C . The caller is a higher-level module that delegates a task to the called (lower-level) function.
D . They are unrelated.
16. What is the primary conceptual difference between a function`s return statement and an output parameter?
A . There is no difference; they are syntactically the same.
B . A return statement can send back one value, while output parameters can be used to return multiple values.
C . Output parameters are used for input, and return is used for output.
D . A return statement modifies the argument directly.
17. What will happen if you pass a NULL pointer to a function that then tries to dereference it (e.g., *ptr = 10;)?
A . The value 10 will be stored at memory address 0.
B . The program will compile and run without any issues.
C . It will typically result in a runtime error, such as a segmentation fault.
D . The pointer will automatically be assigned a new address.
18. The keyword used to define a function that does not return any value in c with values?
A . int
B . void
C . null
D . static
19. Which of the following is correct way to declare and initialize an array in c with values? {10,20,30}
A . int arr[]={10,20,30};
B . int arr[2]={10,20,30};
C . arr={10,20,30};
D . int arr={10,20,30};
20. Which of the following storage class variable will store in CPU register?
A . auto
B . static
C . register
D . extern
21. Which of the following statement is correct?
A . Function avoids rewrite same code in multiple times.
B . Function breakdown complex problem to smaller parts.
C . Functions provide easy debugging.
D . All the above.
22. Function prototype is also called as
A . Function definition.
B . Function declaration.
C . Function call.
D . None of the above.
23. Which of the following statement is correct?
A . Return statement terminate function execution.
B . Return statement execute anything after it.
C . Return statement is a result of function.
D . All the above
24. Which of the following statement is not correct?
A . While writing a function actual parameters must be equal to formal parameters.
B . We can call a function multiple times.
C . Function won’t provide limited access to local variable.
D . Function declaration is optional while writing a function.
25. Which of the following statement is not correct
A . In call by value method, different memory will be allocated to actual parameters and formal parameters.
B . In call by value method, if we do modification in formal parameters that change actual parameters.
C . In call by value method, we modification in formal parameters that won’t change actual parameters.
D . None of the above.
26. Which of the following statement is correct?
A . Function declaration is optional while writing a function.
B . Function call must be inside main ().
C . We can write function anywhere in a program.
D . All the above.
27. Which of the following statement is not correct?
A . Parameters which are passed to function definition is called formal parameters.
B . Parameters which are passed to function call is known as actual parameters.
C . Parameter which are passed to function definition is known as actual parameters.
D . Parameter which are passed to function definition is known as formal arguments.
28. Which of the following statement is not correct ?
A . The default value of auto storage class variable is 0.
B . The scope of auto storage class variable is local.
C . The life of auto storage class variable is with in function or block
D . None of the above
29. Which of the following statement is correct?
A . The default value of static storage class variable is garbage value.
B . The static storage class variable stored in CPU RAM.
C . The scope of static variable is global.
D . None of the above.
30. Which of the following statement is correct?
A . extern storage class variable stored in RAM.
B . Register storage class variable stored in CPU register.
C . Auto storage class variable stored in RAM.
D . All the above.
31. The value passed to a function when it is called is known as a(n)_____.
A . Argument or actual parameter
B . Variable
C . Identifier
D . Function name
32. The dereference operator (*) in C is used to ______
A . Get the address of a variable
B . Access the value stored at the address pointed by a pointer
C . Declare a variable
D . Multiply two numbers
33. A function is a:
A . A set of statements performing a specific task
B . A preprocessor directive
C . A variable
D . A keyword
34. If int *p; and int x = 20; what does p = &x; do?
A . Stores value 20 in pointer
B . Stores address of x in p
C . Creates a new variable
D . Gives an error
35. In C, how are function arguments passed by default?
A . by value
B . by reference
C . by pointer
D . by address
36. Which of the following statements about functions in C is true?
A . A function in C can return more than one value.
B . Every C program must have at least one function named main().
C . A function must always take at least one parameter.
D . Functions in C cannot call other functions.
37. Arguments passed to a function in C language are called ___ arguments.
A . Formal arguments
B . Actual Arguments
C . Definite Arguments
D . Ideal Arguments
38. Which keyword is used to transfer control back from a function to the calling Function?
A . goto
B . return
C . switch
D . exit
39. A function declaration also called as_____________
40. A parameter is known as______________. Which are passed to function call.
41. A parameter is known as ________ which is passed to function definition.
42. Pointer is variable which stores___________ of variable.
43. In ___________method different memory will be allocated to actual parameter and formal parameters.
44. In____________ Method similar memory will be allocated to actual parameters and formal parameters.
45. ___________ block statements to perform specific task.
46. In________ method if we do modification in formal parameters that does not impact in actual parameters.
47. In____________ method if we do modification in formal parameters that will change in actual parameters.
48. ____________ Method address of actual parameter is copy into formal parameter.
49. __________is default return type of function.
50. In pointers "*" is called _________
51. _____ is the default value of auto storage class?
52. Default value of static storage class variable is ________.
53. _______storage class variable is available at multiple source files.
54. _______ storage class variable is stored is CPU register.
55. _______ storage class initialize only time and exists till end of the program.
56. _______ storage class variable scope is global.
57. Array index position starts from __________.
58. A function declaration is also known as a function ________________________
59. The part of a function where code is written is called the __________ of the function.
60. A ___________________ is a block of code that performs specific task.
61. The process of dividing a program into smaller modules or functions is called __________.
62. The variable that receive values from calling functions are called______________
63. In C, function can be categorized as library functions and ___________function.
64. A function that does not return any value must have the return type___________.
65. Variables within a block have global scope.(T/F)____
66. The function that returns square root of a given number is _______
67. scanf () is a _________ function in C program.
68. The syntax for function call is ______________.
69. Default value of Register variable is = ___________________
70. How many values can a C Function return at a time = ___________________
71. A ___________________ is a block of code that performs specific task.
☞ PPS MCQs - Unit-1 - [ PPS ]
☞ PPS MCQs - Unit-2 - [ PPS ]
☞ PPS MCQs - Unit-3 - [ PPS ]
☞ Machine Learning MCQs - Unit-1 - [ ML ]
☞ Machine Learning MCQs - Unit-2 - [ ML ]
☞ Data Mining MCQs - Unit-1 - [ DM ]
☞ Data Mining MCQs - Unit-2 - [ DM ]
☞ Data Mining MCQs - Unit-3 - [ DM ]
☞ Data Mining MCQs - Unit-4 - [ DM ]
☞ Data Mining MCQs - Unit-5 - [ DM ]
☞ Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]
☞ Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]
☞ R - Programming MCQs - Unit-1 - [ R-Programming ]
☞ R - Programming MCQs - Unit-2 - [ R-Programming ]
☞ R - Programming MCQs - Unit-3 - [ R-Programming ]
☞ R - Programming MCQs - Unit-4 - [ R-Programming ]
☞ R - Programming MCQs - Unit-5 - [ R-Programming ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-1 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-2 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-3 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-4 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-5 - [ FLAT ]
☞ Artificial Intelligence (AI) MCQs - Unit-1 - [ Artificial Intelligence ]
☞ Artificial Intelligence (AI) MCQs - Unit-2 - [ Artificial Intelligence ]
☞ Artificial Intelligence (AI) MCQs - Unit-3 - [ Artificial Intelligence ]
☞ Artificial Intelligence (AI) MCQs - Unit-4 - [ Artificial Intelligence ]
☞ Artificial Intelligence (AI) MCQs - Unit-5 - [ Artificial Intelligence ]
☞ Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]
☞ Software Engineering MCQs - Unit-1 - [ SE ]
☞ Software Engineering MCQs - Unit-2 - [ SE ]
☞ Software Engineering MCQs - Unit-3 - [ SE ]
☞ Software Engineering MCQs - Unit-4 - [ SE ]
☞ Software Engineering MCQs - Unit-5 - [ SE ]
☞ Data Structures Objective Type Question Bank-Unit-1 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-2 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-3 - [ DS ]