What is the output of the following code?
void myFunction(int &x, int y) {
x = x + y;
}
int main() {
int a = 5;
int b = 10;
myFunction(a, b);
cout << a << endl;
return 0;
}
What is the output of the following code?
void myFunction(int &x, int y) {
x = x + y; } int main() { int a = 5; int b = 10; myFunction(a, b); cout << a << endl; return 0; }
void myFunction(int &x, int y) {
x = x + y; } int main() { int a = 5; int b = 10; myFunction(a, b); cout << a << endl; return 0; }
Anonymous Quiz
36%
5
8%
10
45%
15
11%
Error
❤2👍1
What is the output of the following code?
void myFunction(int &x, int y) {
x = x + y;
}
int main() {
int a = 5;
int b = 10;
cout << a << endl;
myFunction(a, b);
return 0;
}
What is the output of the following code?
void myFunction(int &x, int y) {
x = x + y; } int main() { int a = 5; int b = 10; cout << a << endl; myFunction(a, b); return 0; }
void myFunction(int &x, int y) {
x = x + y; } int main() { int a = 5; int b = 10; cout << a << endl; myFunction(a, b); return 0; }
Anonymous Quiz
58%
5
29%
15
3%
10
11%
Error
❤1👍1
علم البيانات | DS2 Quizes
Which of the following is important in a function?
هُنا المقصود أي الأجزاء المهمة (الضرورية) في الدوال التي لا يمكن تعريف الدالة بدونها.
https://news.1rj.ru/str/Computer_DS_2/2285
https://news.1rj.ru/str/Computer_DS_2/2285
Telegram
علم البيانات | DS Quizes
Which of the following is important in a function?
Function name / Return type / Both return type and function name / The return type, function name and parameter list
Function name / Return type / Both return type and function name / The return type, function name and parameter list
true or false:
To use a predefined function in a program, you need to know only the name of the function and how to use it.
To use a predefined function in a program, you need to know only the name of the function and how to use it.
Anonymous Quiz
59%
true
41%
false
👏2❤1👍1
👍1
true or false:
Parameters allow you to use different values each time the function is called.
Parameters allow you to use different values each time the function is called.
Anonymous Quiz
84%
true
16%
false
❤1
true or false:
When a return statement executes in a user-defined function, the function immediately exits.
When a return statement executes in a user-defined function, the function immediately exits.
Anonymous Quiz
73%
true
27%
false
❤1
true or false:
A value-returning function returns only integer values.
A value-returning function returns only integer values.
Anonymous Quiz
30%
true
70%
false
❤1
true or false:
A function that changes the value of a reference parameter also changes the value of the actual parameter.
A function that changes the value of a reference parameter also changes the value of the actual parameter.
Anonymous Quiz
78%
true
22%
false
❤1
true or false:
A variable name cannot be passed to a value parameter.
A variable name cannot be passed to a value parameter.
Anonymous Quiz
42%
true
58%
false
true or false:
If a C++ function does not use parameters, parentheses around the empty parameter list are still required.
If a C++ function does not use parameters, parentheses around the empty parameter list are still required.
Anonymous Quiz
67%
true
33%
false
🥰2❤1
true or false:
In C++, the names of the corresponding formal and actual parameters must be the same.
In C++, the names of the corresponding formal and actual parameters must be the same.
Anonymous Quiz
44%
true
56%
false
👍1
true or false:
Whenever the value of a reference parameter changes, the value of the actual parameter changes.
Whenever the value of a reference parameter changes, the value of the actual parameter changes.
Anonymous Quiz
79%
true
21%
false
❤1
true or false:
In C++, function definitions can be nested; that is, the definition of one function can be enclosed in the body of another function.
In C++, function definitions can be nested; that is, the definition of one function can be enclosed in the body of another function.
Anonymous Quiz
58%
true
42%
false
👍1
true or false:
Using global variables in a program is a better programming style than using local variables, because extra variables can be avoided.
Using global variables in a program is a better programming style than using local variables, because extra variables can be avoided.
Anonymous Quiz
68%
true
32%
false
❤1
true or false:
In a program, global constants are as dangerous as global variables.
In a program, global constants are as dangerous as global variables.
Anonymous Quiz
59%
true
41%
false
true or false:
The memory for a static variable remains allocated between function calls
The memory for a static variable remains allocated between function calls
Anonymous Quiz
75%
true
25%
false
🥰1
Which of following is category of simple data type ?
Anonymous Quiz
35%
integral
4%
floating-point
22%
enumeration
39%
all of above
علم البيانات | DS2 Quizes
An inline function is expanded during _.
<هُنا >
الإجابة الصحيحة :
compile-time
الدوال المضمنة (Inline Functions)
تعريفها:
هي دوال صغيرة الحجم يتم تعريفها مباشرة داخل سطر واحد من الكود.
تُستخدَم غالبًا للتعبيرات البسيطة التي لا تتطلب منطقًا معقدًا.
يتم استبدال استدعاء الدالة المضمنة بالكود الخاص بها مباشرة أثناء عملية الترجمة (Compilation)، مما يُحسِّن من أداء البرنامج.
Telegram
علم البيانات | DS Quizes
An inline function is expanded during _.
End of the program / Never expanded / Run-time / Compile-time
End of the program / Never expanded / Run-time / Compile-time
🤔1