Where the file named File.txt? a) program b) disk drive c) screen d) keyboard Th
ID: 3848813 • Letter: W
Question
Where the file named File.txt? a) program b) disk drive c) screen d) keyboard The expression getline (cin, message) will continuously accept and store characters typed at the terminal keyboard until th _____ key is pressed. a) Shift b) Enter c) ESC d) Ctrl Which of the following is false about a function to which any array is being passed? a) It always knows the size of the array that is being passed. b) It is being passed the address of the first element in the array. c) It is able to modify the values stored in the array. d) The array name is used as an argument in the function call. When an argument is passed-by value, changes to that argument in the called function ______ affect the original variables value. a) do b) do not c) may d) may or may not In the expression n = 1 + [] %6, the maximum value of n will be: a) 2 b) 4 c) 6 d) 8 c++ functions other than main are executed a) before main executes b) after main executes c) when they are called by another function. d) None of the above. Two adjacent variable names in a single declaration are separated by __________ symbol. a) dot b) comma c) parentheses d) braces The data type of function returns in c++ cannot be a) int b) void c) double d) function sizeof for a string returns a) integer b) string c) double d) boolExplanation / Answer
Que 17: Option b)
Explaination : The file which we read in program exists on disk drive, the program just reads it's contents.
Que 18: Option b) Enter
Que 19: Option C)
Explaination: A function to which an array is passed as an argument, it can not modify the values stored in the original array.
For Example Given program will Output a[0] = 1.
#include <iostream>
using namespace std;
void mystery(int* a)
{
a[0] = 55;
}
int main()
{
int a1[3] = {1,1,3};
mystery(a1);
cout << a1[0] << endl;
return 0;
}
Question 20: Option b
Explaination: If as argument is passed by value, then changes to that argument in the called function do not change the original variable's value.
Consider following program, value of a will remain unchanged!
#include <iostream>
#include <stdlib.h>
#include <time.h>
using namespace std;
void mystery(int a)
{
a = 55;
}
int main()
{
int a = 2;
mystery(a);
cout << a << endl;
return 0;
}
Question 21: Option C
Explaination: The rand()%6 term will output values from 0 to 5.
So max value of 1 + rand()%6 = 6
Question 22: Option C
Explaination: In a c++ program, main function is executed first, All the functions other than main function, are executed whenever they are called inside main methode or inside any other function.
Question 23: Option b
Explaination: For example, if you want to declair 2 integer variables, we should write it as follows:
int variable1, variable2;
Question 24: Option d
Explaination: A function can not return other function.
Question 25: Option a
Explaination: Size() of array returns integer value.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.