Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int arr[] = {4, 5, 6, 7}; int *p = (arr + 1); cout << arr; return 0; }
Q2
What is the output of the following code: struct Student { int roll; }; Student s1; s1.roll = 101; cout << s1.roll; in C++?
Q3
Which of the following statement is not true about preprocessor directives?
Q4
Which keyword is used to define a structure in C++?
Q5
What will be the output of the following C++ code? #include<iostream> using namespace std; int &fun() { int x = 10; return x; } int main() { fun() = 30; cout << fun(); return 0; }
Q6
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int arr[] = {4, 5, 6, 7}; int *p = (arr + 1); cout << *p; return 0; }
Q7
What does a reference provide?
Q8
What is the purpose of typedef in C++ structures?
Q9
What is a union in C++?
Q10
What are the references in C++?
Q11
What is the purpose of using structures in C++?
Q12
What is the difference between a structure and a union in C++?
Q13
Which of the following operator is used while declaring references?
Q14
The difference between x and 'x' is?
Q15
How a reference is different from a pointer?
Q16
Which of the following statement(s) is/are correct?
Q17
What is a structure in C++?
Q18
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int a = 5, c; void *p = &a; double b = 3.14; p = &b; c = a + b; cout << c << '\n' << p; return 0; }
Q19
The void pointer can point to which type of objects?
Q20
What is the correct way to access members of a structure in C++?
Q21
What will be the output of the following C++ code? #include <iostream> using namespace std; int func(void *Ptr); int main() { char *Str = "abcdefghij"; func(Str); return 0; } int func(void *Ptr) { cout << Ptr; return 0; }
Q22
What does the following statement mean? int (*fp)(char*)
Q23
What is the correct way to pass a structure to a function in C++?
Q24
What will be the output of the following C++ code? #include <iostream> using namespace std; int main() { int a = 9; int & aref = a; a++; cout << "The value of a is " << aref; return 0; }
Q25
How do you declare a structure variable in C++?