+ 1

What is the output of this code? int arr[] = {2, 4, 6}; int x = (*arr + 1) * (*(arr + 1)); cout << x;

What is the output of this code? int arr[] = {2, 4, 6}; int x = (*arr + 1) * (*(arr + 1)); cout << x;

30th Aug 2020, 2:55 PM
Bayzid
Bayzid - avatar
1 ответ
+ 5
Always when you see, *arr it means arr[0] and when you see *(arr + n) which means arr[0+n] so now solve it : x = (arr[0] + 1) * (arr[0+1]) => x = 3*4 Therefore x = 12
30th Aug 2020, 3:04 PM
Мг. Кнап🌠
Мг. Кнап🌠 - avatar
Актуальное сегодня
What?
0 Votes
HTML
0 Votes
FRC Coding?
1 Votes
Quiz duel
0 Votes
help
0 Votes
AI
2 Votes
APIs
1 Votes
Create Agent
0 Votes