LIVE Course for free

Rated by 1 million+ students
Get app now
0 votes
115 views
in Information Technology by (48.1k points)
closed by

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 _________.

1 Answer

0 votes
by (30.0k points)
selected by
 
Best answer

int  *ip = arr + 4 //ip is a integer pointer pointing to 5 element of the array

ip[1] = *(ip + 1xsizeofint) = *(address of 6th element) = 6

Related questions

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...