Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

main()
{
int arr[]={12,14,16,18,20}
printf("%u%u";arr+1,&arr+1);
}
//tell me the answer of this question with proper reason..:)//

Answer Posted / rpr

The correct question should be:

main()
{
int arr[]={12,14,16,18,20};
printf("%u%u",arr+1,&arr+1);
}

there are two different notations:
arr+1 and &arr+1;

arr is same as &arr[0] - location of arr[0], first element
arr+1 is same as &arr[1] - location of arr[1]
arr+2 is same as &arr[2] - location of arr[2]
and so on...

here if address of arr is 6524 then address of arr+1 is
6526, address of arr+2 is 6528.. as arr is of int type so a
difference of two.

now about &arr
it represents the location of entire array.
so it will gives address of first element of array.
when 1 is added to it, the size of array is added to it..

example..

if the address of first element,arr[0] is 6524
and the size of array is-
-(no. of elements)*(size of each element)
here 5*2=10

then,
&arr = 6524
&arr+1 = 6524+(1*size of array)=6524+(1*10)=6534
&arr+2 = 6524+(2*10)=6544
and so on..

one more point:
as here notations are behaving in a pointer manner(actually
reference).. you should know pointer saves values in
unsigned int- from 0-65535
..
once the value of pointer reaches 65535, it comes back to 0.

-rpr..ravidasonline@gmail.com

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

5. Tell me about a time you were able to successfully deal with another person even when that individual may not have personally liked you (or vice versa).

1943


how to use two diffirent gatway in one system

1810


how to generate linked implementation of sparse matrix?

1937


WHY WE USE {} AT THE STARTING OF C PROGRAM

1886


how the class is instance of object?

2415


how to increase the chiller effiency?

1965


Name a accredited or govt approved university which have 100% online engineering course

1736


write program which accept information about 5 student & display same information according to ascending order of their name??

2835


can i learn ad. java without learned core java? java is best or .net is best for summer training?

1902


how to use photoshop and some related websites?

2000


please tell me difference between router and cisco router

2038


PLZ SOMEONE TELL ME WHICH TYPE OF QUESTIONS IS ASKED IN HLL(Hindustan latex ltd.)mangmt trainee entrance exam?

1905


Prove that in a self-complementing code the sum of the weights must be 9?

30219


How do aeroplanes fly? Why can some fly up-side down?

959


to print greatest of two integers without using >,<,=.

1775