What does the following statement mean?
What will be the output of the following C++ code?
#include
#include
using namespace std;
int array1[] = {1200, 200, 2300, 1230, 1543};
int array2[] = {12, 14, 16, 18, 20};
int temp, result = 0;
int main()
{
for (temp = 0; temp < 5; temp++)
{
result += array1[temp];
}
for (temp = 0; temp < 4; temp++)
{
result += array2[temp];
}
cout << result;
return 0;
}
What is the other name used for functions inside a class?
What will be the output of the following C++ code?
#include
using namespace std;
int main()
{
char arr[20];
int i;
for(i = 0; i < 10; i++)
*(arr + i) = 65 + i;
*(arr + i) = '\0';
cout << arr;
return(0);
}
What will be the output of the following C++ code?
#include
using namespace std;
int max(int a, int b )
{
return ( a > b ? a : b );
}
int main()
{
int i = 5;
int j = 7;
cout << max(i, j );
return 0;
}
Which function is used to read a single character from the console in C++?
What are the advantages of passing arguments by reference?
Which of the following operator is used with this pointer to access members of a class?
What will be the output of the following C++ code?
#include
using namespace std;
int main()
{
int a = 5, b = 10, c = 15;
int *arr[ ] = {&a, &b, &c};
cout << arr[1];
return 0;
}
Which of the following C++ code will give error on compilation?
================code 1=================
#include
using namespace std;
int main(int argc, char const *argv[])
{
cout<<"Hello World";
return 0;
}
========================================
================code 2=================
#include
int main(int argc, char const *argv[])
{
std::cout<<"Hello World";
return 0;
}
What will be the output of the following C++ code?
#include
using namespace std;
int main()
{
char *ptr;
char Str[] = "abcdefg";
ptr = Str;
ptr += 5;
cout << ptr;
return 0;
}
What will happen in the following C++ code snippet?
int a = 100, b = 200;
int *p = &a, *q = &b;
p = q;
What are mandatory parts in the function declaration?
Wrapping data and its related functionality into a single entity is known as _____________
What will be the output of the following C++ code?
#include
using namespace std;
int add(int a, int b);
int main()
{
int i = 5, j = 6;
cout << add(i, j) << endl;
return 0;
}
int add(int a, int b )
{
int sum = a + b;
a = 7;
return a + b;
}
When will we use the function overloading?
Which of the following permits function overloading on c++?
What will be the output of the following C++ code?
#include
using namespace std;
long factorial (long a)
{
if (a > 1)
return (a * factorial (a + 1));
else
return (1);
}
int main ()
{
long num = 3;
cout << num << "! = " << factorial ( num );
return 0;
}
Out of the following, which is not a member of the class?
What is the index number of the last element of an array with 9 elements?
How many minimum number of functions should be present in a C++ program for its execution?
Which is more effective while calling the functions?
Which of the following feature is used in function overloading and function with default argument?
Which of the following escape sequence represents tab?