MCQOPTIONS
Bookmark
Saved Bookmarks
→
C++ Programming
→
Constructors And Destructors in C++ Programming
→
How many ways of passing a parameter are there in ..
1.
How many ways of passing a parameter are there in c++?
A.
4
B.
3
C.
2
D.
1
E.
None of these
Answer» C. 2
Show Answer
Discussion
No Comment Found
Post Comment
Related MCQs
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <stdarg.h><br> using namespace std;<br> void function(std::string message, ...);<br> int main()<br> {<br> function("InterviewMania", 5, 7, 10, 8, 9);<br> return 0;<br> }<br> void function(std::string message, ...)<br> {<br> va_list ptr;<br> int number;<br> va_start(ptr, message);<br> number = va_arg(ptr, int);<br> number = va_arg(ptr, int);<br> cout << number;<br> }<br></stdarg.h></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <stdarg.h><br> using namespace std;<br> int funcion(char ch,...);<br> int main()<br> {<br> int p, q;<br> p = funcion('B', 2, 3, 4);<br> q = funcion('3', 2.0, 2, '3', 2.0f, 10);<br> cout << p< return 0;<br> }<br> int funcion(char ch,...)<br> {<br> return ch;<br> }<br></stdarg.h></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> int add(int p, int q);<br> int main()<br> {<br> int n = 15, m = 16;<br> cout << add(n, m) << endl;<br> return 0;<br> }<br> int add(int p, int q )<br> {<br> int sum = p + q;<br> p = 20;<br> return p + q;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> void square (int *p)<br> {<br> *p = (*p + 1) * (*p);<br> }<br> int main ( )<br> {<br> int n = 11;<br> square(&n);<br> cout << n; <br> return 0;<br> }<br></iostream></pre>
What is the new value of P?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> void function(int &p)<br> {<br> p = 15;<br> }<br> int main()<br> {<br> int p = 12;<br> function(p);<br> cout << "New value of P is " << p;<br> return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> int function(int p = 12, int q)<br> {<br> int s;<br> s = p + q;<br> return s;<br> }<br> int main()<br> {<br> cout << function(15);<br> return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> using namespace std;<br> void copy (int& p, int& q, int& r)<br> {<br> p = p * 1;<br> q = q * 2;<br> r = r * 3;<br> }<br> int main ()<br> {<br> int m = 6, n = 3, o = 2;<br> copy (m, n, o);<br> cout << "M = " << m << ", N = " << n << ", O = " << o;<br> return 0;<br> }<br></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <stdarg.h><br> using namespace std;<br> int Addition(int number, ...)<br> {<br> int sum = 0;<br> va_list args;<br> va_start (args,number);<br> for (int i = 0; i < number; i++) <br> {<br> int number = va_arg (args,int);<br> sum += number;<br> }<br> va_end (args);<br> return sum;<br> }<br> int main (void)<br> {<br> int Result = Addition(1, 10, 9, -1, 13, 23, -2, 9, 17);<br> cout << "The result is " << Result;<br> return 0;<br> }<br></stdarg.h></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <stdarg.h><br> using namespace std;<br> float avg( int Count, ... )<br> {<br> va_list num;<br> va_start(num, Count);<br> int Sum = 0;<br> for (int i = 0; i < Count; ++i )<br> Sum += va_arg(num, int);<br> va_end(num);<br> return (Sum/Count);<br> }<br> int main()<br> {<br> float AVG = avg(5, 0, 1, 2, 3, 4);<br> cout << "Average of first 5 whole numbers : " << AVG;<br> return 0;<br> }<br></stdarg.h></iostream></pre>
What is the output of this program?<br><pre class="prettyprint lang-c">#include <iostream><br> #include <string><br> using namespace std;<br> string askMessage(string Message = "Please enter a message: ");<br> int main()<br> {<br> string Input = askMessage();<br> cout << "Here is your message: " << Input;<br> return 0;<br> }<br> string askMessage(string Message)<br> {<br> string Input;<br> cout << Message;<br> cin >> Input;<br> return Input;<br> }<br></string></iostream></pre>
Reply to Comment
×
Name
*
Email
*
Comment
*
Submit Reply