
Mcq’s
1. A function is invoked with a
a. Function Definition |
b. Function Declaration |
c . Function Call |
d. Function Return |
2. What is the only function all C++ programs must contain?
a. start() |
|
|
||
b. system() |
|
|
||
c. main() |
|
|
||
d. |
|
|
||
|
|
|
||
3. A function that calls itself either directly or indirectly is a(n) function.
a. Infinite Function |
b. Recursive Function |
c. Prototype Function |
4. Structures may not be compared by using operators == and !=.
True
False
5. Structures are always passed to functions by call by reference method.
True
False
6. Same names can be used for different functions without any conflict.
True
False
7. A recursive function typically has two components: one that provides a means for the recursion to terminate by testing for a case, and one that expresses the problem as a recursive call for a slightly simpler problem than the original call.
True
False
8. Members of different structures must have unique names.
True
False
9. a Structure
Function |
Prototype |
10. Keyword is used in a function header to indicate that a function does not return a value or to indicate that a function contains no parameters.
True
False

Trending nowThis is a popular solution!
Step by stepSolved in 10 steps with 1 images

- Create a function in C language that takes two integers x, and y as the parameters and returns the sum and the absolute difference of both the numbers but the return type of the function should be void. You can add extra parameters to the function but the function should not return anything and should send the required values as well. Test your function for the numbers 10, and 5 inside the main function.arrow_forwardC++ CODEarrow_forwardProblem taken from LeetCode // Problem Statement : // You are given a string. // Write a function that takes a string as input and reverse only the vowels of a string. // Example : // Sample Input - 1 : // "hello" // Sample Output - 1 : // "holle" // Sample Input - 2 : // "leetcode" // Sample Output - 2 : // "leotcede" class Solution {public: string reverseVowels(string s) { int i = 0 , j = s.size() - 1; while(i < j) { while(i < j && (s[i] != 'a' && s[i] != 'e' && s[i] != 'i' && s[i] != 'o' && s[i] != 'u' && s[i] != 'A' && s[i] != 'E' && s[i] != 'I' && s[i] != 'O' && s[i] != 'U' )) { i++;…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





