Q. What is the output of the following code?

Code:
int arr[] = {1,2,3};
printf("%d", *(arr+1));
  • (A) 1
  • (B) 2
  • (C) 3
  • (D) Undefined
πŸ’¬ Discuss
βœ… Correct Answer: (B) 2
Explanation: arr+1 points to the second element of the array.
Explanation by: Mr. Dubey
arr+1 points to the second element of the array.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
70
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
89%
Success Rate