Professional Documents
Culture Documents
Expert c++ quiz
Expert c++ quiz
Expert c++ quiz
22. Which of the following is a correct way to create a pointer to an integer variable in C++?
- A) int *p;
- B) int &p;
- C) int p*;
- D) int p&;
- Answer: A) int *p;
5;
cout << (x > 3 ? x < 4 ? 10 : 8 : 7);
```
- A) 10
- B) 8
- C) 7
- D) Error
- Answer: B) 8
30. Which of the following is not a valid way to declare a string in C++?
- A) string str = "Hello";
- B) char str[] = "Hello";
- C) char *str = "Hello";
- D) String str = "Hello";
- Answer: D) String str = "Hello";
fi
fi