What are mandatory parts in the function declaration?
Which of the following is the correct syntax of including a user defined header files in C++?
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int mult (int x, int y)
{
int result;
result = 0;
while (y != 0)
{
result = result + x;
y = y - 1;
}
return(result);
}
int main ()
{
int x = 5, y = 5;
cout << mult(x, y) ;
return(0);
}
What is the other name used for functions inside a class?
When will we use the function overloading?
How many types of polymorphism are there in C++?
Which of the following escape sequence represents tab?
Which of the following is correct?
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
char *ptr;
char Str[] = "abcdefg";
ptr = Str;
ptr += 5;
cout << ptr;
return 0;
}
If the user did not supply the value, what value will it take?
Which of the following feature is used in function overloading and function with default argument?
What will be the output of the following C++ code?
#include <iostream>
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 of the following is called address operator?
Identify the incorrect statement
What is an inline function?
Which of the following permits function overloading on c++?
Which concept allows you to reuse the written code?
Which is more effective while calling the functions?
Which function is used to read a single character from the console in C++?
Which of the following C++ code will give error on compilation?
================code 1=================
#include <iostream>
using namespace std;
int main(int argc, char const *argv[])
{
cout<<"Hello World";
return 0;
}
========================================
================code 2=================
#include <iostream>
int main(int argc, char const *argv[])
{
std::cout<<"Hello World";
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
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 happen in the following C++ code snippet?
int a = 100, b = 200;
int *p = &a, *q = &b;
p = q;
What will be the output of the following C++ code?
#include <iostream>
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;
}
What does the following statement mean?
What will be the output of the following C++ code?
#include <iostream>
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;
}