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

can any one give 10 ways to create a file in unix...???? through command prompt....

2467


I am helping a friend to design a concert hall. No need for super architectural show off. Just a rectangular box. Knowing that in my country constructions are done with reinforced concrete and concrete blocks and that the hall's dimensions are, length: 75 meters, width: 32m height: 9m, and that there should not be any columns inside, what would be the size of the columns, beams and roof slab ?

1795


How To Servers For Malitnationl Bank?

1799


I need to know the process to add 100 tapes in ATL. Ho to inicialize them to the system? How is all the process i need to follow> Thanks

2262


Has anyone attended any interviews in IITs for the positions like Research Associates/Fellowships?

1907


Why there is Powerfactor difference when we compare to our Capacitive Panel and TNEB side?

1907


explain various problem solving statagis

1977


please provide me the type of questions or question pattern of bally.

1897


Friends Any one tell me the best institute for the telecom protocol course

2058


Anyone have thesis paper about "Electrical Load Forecasting" . Or the web addresses where people usually upload their thesis paper except IEEE.

1856


How do an incremental process model and certification work together to produce high quality software? In your own words, describe the intent of certification in the clean room software engineering context.

2003


what is the number of water, sand and cement required for moulding brick?

1387


what is the concept of c++ class

1910


hi ,,,,I m going to attend corporate bank exam of specialist IT officer, I don't Know What type of question arise in interview..some suggest me my email id is surinder.singh.btech@gmail.com

2023


verbal quiz and answers

1808