What will be the output of the following C++ code?
What will be the output of the following C++ code?
What is the data type of the result of the following operation?
(float)a * (int)b / (long)c * (double)d
How are the constants declared?
a)
b)
c)
d)
What is the output of the following C program?
int main()
{
char *ptr = "software";
ptr++;
printf("%s", ptr);
return 0;
}
What are the main design requirements for building a container data structure from scratch?
What is the output of the following program?
main()
{
int marks = 60;
if (marks++ > 59 && marks++ != 60 && marks++ > 60)
printf("%d", ++marks);
else
printf("%d", marks--);
}
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;
}
Which of the following statements is correct regarding the switch control expression?
#include <iostream>
struct A { int data[2];
A(int x, int y) : data{x, y} {}
virtual void f() {}
};
int main(int argc, char **argv)
{
A a(44, 55);
int *arr = (int *) &a;
std::cout << arr[2] << std::endl;
return 0;
}