The subscript operator is used to access which elements?
Destructor has the same name as the constructor and it is preceded by ______ .
Which C++ header file is required to use built-in functors?
To which of the following access specifiers are applicable?
To save memory when using heap operations, what should you do?
What will be the output of the following program if a is replaced by -1 in the second line of the code?
main()
{
int b, a = -1;
b = (a == 0) ? 2 : 3;
printf("%d", b);
}
What will be the output of the following C code?
#include <stdio.h>
struct student {
int no;
char name[20];
};
int main() {
struct student s;
s.no = 8;
printf("%d", s.no);
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
int a = 8;
cout << "ANDing integer 'a' with 'true' :" << a && true;
return 0;
}
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main ()
{
int numbers[5];
int * p;
p = numbers; *p = 10;
p++; *p = 20;
p = &numbers[2]; *p = 30;
p = numbers + 3; *p = 40;
p = numbers; *(p + 4) = 50;
for (int n = 0; n < 5; n++)
cout << numbers[n] << ",";
return 0;
}
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;
}
========================================