51. What is the scope of the variable declared in the user defined function?
52. If an argument from the parameter list of a function is defined constant then . . . . . . . .
53. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void Funct();
int main()
{
try
{
Funct();
}
catch(double)
{
cerr << "caught a double type..." << endl;
}
return 0;
}
void Funct()
{
throw 3;
}
#include <iostream>
using namespace std;
void Funct();
int main()
{
try
{
Funct();
}
catch(double)
{
cerr << "caught a double type..." << endl;
}
return 0;
}
void Funct()
{
throw 3;
}
54. What will be the output of the following C++ code?
#include <iostream>
using namespace std;
void Sum(int a, int b, int & c)
{
a = b + c;
b = a + c;
c = a + b;
}
int main()
{
int x = 2, y =3;
Sum(x, y, y);
cout << x << " " << y;
return 0;
}
#include <iostream>
using namespace std;
void Sum(int a, int b, int & c)
{
a = b + c;
b = a + c;
c = a + b;
}
int main()
{
int x = 2, y =3;
Sum(x, y, y);
cout << x << " " << y;
return 0;
}
55. Identify the correct statement.
56. which of the following can be passed in function pointers?
57. Where should default parameters appear in a function prototype?
58. What will be the output of the following C++ code?
#include <iostream>
#include <string>
using namespace std;
namespace A{
int var = 10;
}
namespace B{
int cout = 5;
}
int main()
{
using namespace B;
cout<<A::var;
}
#include <iostream>
#include <string>
using namespace std;
namespace A{
int var = 10;
}
namespace B{
int cout = 5;
}
int main()
{
using namespace B;
cout<<A::var;
}
59. Which is more effective while calling the functions?
60. What is similar to the interface in c++?
Read More Section(Functions and Procedures in C plus plus)
Each Section contains maximum 100 MCQs question on Functions and Procedures in C plus plus. To get more questions visit other sections.