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 / 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 |
Hi I need exam pattern for ECIL Computer/IT category...
What is the latest Exchange 2003 Service Pack? Name a few changes in functionality in that SP.
Streams can be for writing the data to a.txt file
How to write a test case for an extra Commerce website can any one tell this with the help of a table
Give an algorithm for the following problem and determine its time complexity. Given a list of n distinct positive integers, partition the list into two sublists, each of size n/2, such that the difference between the sums of the integers in the two sublists is maximized. You may assume that n is a multiple of 2 (i.e. n is even).
Automation of XYZ Soft drink parlour XYZ Soft drink Parlour wants to automate its functionalities. The Admin can add new items in the stock and also update the details of the existing items. The items are only soft drinks .The details to be maintained are Item’s name, quantity and price. The salesman can view the availability of the items as per the order placed then confirms the order. At the end of day the Admin generates a report of the total sales (total quantity and price of individual items). Identify the Joins , union, and Cartesian product Report.
hai im going to face ibps SO IT officers grade 1 interview. if anyone had an idea plz tel me expected and experienced questions and mail to anusha_k_anu@yahoo.com
HI!I AM A STUDENT OF B.TECH 3RD YEAR.I PASSED SECONDARY EXAM IN 2001 & HIGHER SECONDARY EXAM 2003.BUT I DROP 1 YEAR AND ADMITTED IN B.TECH 2004 DUE TO FINANCIAL CRISIS.WHEN INTERVIEWER LOOK AT MY C.V HE WANT 2 KNOW WHAT U DID IN THAT MISSED YEAR? I GET PUZZLED 2 ANSWER THIS QUESTION AS I CAN NOT FIND ANY BOLDER ANSWER.PLZ SUGGEST ME SOME BOLD ANS. THAT INTERVIEWER CAN NOT FIND ANY COUNTER QUARY.... 0 2
what are the examples of E-Based Applications?
hi this is padhu i just want to know about remote sensing scientist in ISRO, will there a written test or not if there are any model test papers plz post it.
why IT?
what are the things to be mentioned for the question "Tell me about yourself??