14 votes 14 votes Consider the following C program: #include <stdio.h> int main() { int arr[]={1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 5}, *ip=arr+4; printf(“%d\n”, ip[1]); return 0; } The number that will be displayed on execution of the program is _______ Programming in C gatecse-2019 numerical-answers programming-in-c programming array easy 1-mark + – Arjun asked Feb 7, 2019 • retagged Dec 26, 2023 by Hira Thakur Arjun 13.7k views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply Ashwani Kumar 2 commented Jun 3, 2019 reply Follow Share arr is base address of element $1$. arr+$4$ is base address of element $5$. Let it ip. ip[$1$]=*(ip+$1$)= Base address of element $6$. 6 is the answer. 2 votes 2 votes subbus commented Apr 27, 2020 reply Follow Share *p = arr + 4 = arr[4] *(p+0) = arr[4] *(p+1) = arr[4+1] = arr[5] 0 votes 0 votes mahendrapatel commented Jan 23, 2023 reply Follow Share Easy 0 votes 0 votes himanshud2611 commented Jan 28 reply Follow Share ip[1] is *(ip+1) i.e 6 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes The program asks for what is the out put of printing ip[1] ,for that we need to understand what ip[1] represents here .it represents the second element of ip[ ] .What ip[ ] represents ? it represents arr[4] so what ip[1] will represent it will be arr[4+1] which is 6 . _shashi answered Feb 7, 2019 _shashi comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes After executing the line---- *ip=arr+4 ip will point to the element 5. so ip[0]=5 ip[1]=6 ip[2]=7 ...... Answer-->6 Arnabh Gangwar answered Oct 3, 2019 Arnabh Gangwar comment Share Follow See all 0 reply Please log in or register to add a comment.