ECE DEPARTMENT : NOTICE BOARD

ADVISORY TO STUDENTS (Answer to "Sir, College is there today ?")

Quote :
"If egg is broken by outside force, life ends. If broken by inside force, life begins. Great things always begin from inside force, trust yourself."

Batchwise blogs: -2008 | 2009 | 2010 | 2011 | 2012

Internal Marks Sem-II : | 2011 | 2010 | 2009 |

Intro | Case 1 | Case 2 | Case 3 | Case 4 | Case 5 |

Previous Posts

Tuesday, July 06, 2010

06th July : C Program























ciao...

5 comments:

  1. Sir,
    Its output would be:

    array[0]01 /*for 1st set of printf statements
    array[1]1011 /*for 2nd set printf statements
    array[2]2021 /*for 3rd set printf statements

    ReplyDelete
  2. Sir,

    in the printf statements it should be array[0][0] instead of array[0,0]

    then the output would be

    array[0]01
    array[1]1011
    array[2]2021

    but if the code " array[0,0] " is correct in the given printf statements then the out may differ....

    ReplyDelete
  3. Bharat,
    Relook into the code just as a compiler does :)
    looking forward for a change of opinion.
    Good try...

    ReplyDelete
  4. Yes sir,
    Its output is

    array[0]900904
    array[1]900904
    array[2]900904

    I think the values 900 and 904 are the positions or the co-ordinates which mainly depend upon the dimension of the array[3][2].
    (Here 900+2*2=904)

    ReplyDelete
  5. Sir,
    the output is:

    array[0]888892
    array[1]888892
    array[2]888892

    in general the output for the first set of printf statements can be obtained as array[0]aaabbb, where aaa and bbb are the integers with difference between them as 4.
    In general,
    the syntax "array[x,y]" refer to the address of the elements which are the very first elements of the first two rows present in the same column, irrespective of the values of x and y.
    Since the given array is a matrix of 3 rows and 2 columns, the syntax "array[x,y]" refer to the address of first elements of the first two rows i.e, they refer to the address of the elements at array[0][0] and array[1][0].
    Since the array is declared as an Integer type array each element in it will occupy a space of 2 bytes. As the difference between the address of array[0][0] and array[1][0] is 4 we get a difference as 4.... Hence the output.

    array[0]aaabbb
    array[1]aaabbb
    array[2]aaabbb

    with difference between the integers aaa and bbb as 2*2=4.

    ReplyDelete