31. What is most suitable for returning the logical errors in the program?
32. What happens if try catch block is not used?
33. What will be the output of the following C++ code?
#include <iostream>
#include <stdarg.h>
using namespace std;
float avg( int Count, ... )
{
va_list Numbers;
va_start(Numbers, Count);
int Sum = 0;
for (int i = 0; i < Count; ++i)
Sum += va_arg(Numbers, int);
va_end(Numbers);
return (Sum/Count);
}
int main()
{
float Average = avg(10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
cout << Average;
return 0;
}
#include <iostream>
#include <stdarg.h>
using namespace std;
float avg( int Count, ... )
{
va_list Numbers;
va_start(Numbers, Count);
int Sum = 0;
for (int i = 0; i < Count; ++i)
Sum += va_arg(Numbers, int);
va_end(Numbers);
return (Sum/Count);
}
int main()
{
float Average = avg(10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9);
cout << Average;
return 0;
}34. What is the default value of a bitset?
35. What will be the output of the following C++ code?
#include <iostream>
#include <string>
#include <tuple>
using namespace std;
int main()
{
tuple <int, char, string> tp;
tp = make_tuple(4, '1', "Hello");
cout<<tuple_size<decltype(tp)>::value;
return 0;
}
#include <iostream>
#include <string>
#include <tuple>
using namespace std;
int main()
{
tuple <int, char, string> tp;
tp = make_tuple(4, '1', "Hello");
cout<<tuple_size<decltype(tp)>::value;
return 0;
}36. What are Templates in C++?
37. Which header file is required to use accumulate() function?
38. How the sequence of objects can be accessed?
39. What will be the output of the following C++ code?
#include <stdio.h>
#include <ctype.h>
int main ()
{
int i = 0;
char str[] = "Steve Jobs\n";
char c;
while (str[i])
{
c = str[i];
if (islower(c))
c = toupper(c);
putchar (c);
i++;
}
return 0;
}
#include <stdio.h>
#include <ctype.h>
int main ()
{
int i = 0;
char str[] = "Steve Jobs\n";
char c;
while (str[i])
{
c = str[i];
if (islower(c))
c = toupper(c);
putchar (c);
i++;
}
return 0;
}40. Which operator is used to deallocate the memory?
Read More Section(C plus plus miscellaneous)
Each Section contains maximum 100 MCQs question on C plus plus miscellaneous. To get more questions visit other sections.
- C plus plus miscellaneous - Section 1
- C plus plus miscellaneous - Section 2
- C plus plus miscellaneous - Section 3
- C plus plus miscellaneous - Section 4
- C plus plus miscellaneous - Section 5
- C plus plus miscellaneous - Section 6
- C plus plus miscellaneous - Section 7
- C plus plus miscellaneous - Section 8
- C plus plus miscellaneous - Section 9
- C plus plus miscellaneous - Section 11
