MCQ
Single Best Answer
Easy
QWhat is the output of the following C code?
#include
int main() {
int arr[] = {1, 2, 3, 4, 5};
printf("%d", *(arr + 2));
return 0;
}
ID: #7202
Fundamentals of C Language
270 views
Question Info
#7202Q ID
EasyDifficulty
Fundamentals of C LanguageTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option C
Explanation
Answer: C
Explanation: The expression *(arr + 2) is equivalent to arr[2], which accesses the third element of the arr array. Therefore, the output will be 3.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic