3i Infotech Placement: Sample Questions 552 - 553 of 1245

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 552

Describe in Detail Essay▾

What is the output of the following program?

  1. void main ()
  2. {
  3. int k =ret (sizeof (float) );
  4. printf ( “ here value is %d” ++ k);
  5. }
  6. int ret (int ret)
  7. {
  8. ret += 2.5;
  9. return (ret);
  10. }
Edit

Explanation

Here value is 7

In the program

Table Shows the Program
int k = ret (sizeof (float) ) ;Firstly, the function ret () is called in which the sizeof (float) i.e.. , 4 is passed.
int ret (int ret)

{

ret += 2.5;

return (ret) ;

}

The int ret (int ret) , i.e.. , the function name and the argument name can be the same.

the sizeof (float) i.e.. , 4 is passed after the first expression the value in ret will be 6, as ret is integer hence the value stored in ret will have implicit type conversion from float to int (which truncates the decimal part- there is no round off)

printf ( “here value is % d” ++ k) ;The ret is returned in main () it is printed after the preincrement that is 6 becomes 7.

Question 553

Describe in Detail Essay▾

What is ROWID?

Edit

Explanation

  • Every record has a unique ROWID within a database reprinting the physical location on disk where the record lives.
  • The ROWID is a unique database-wide physical address for every row on every table.
  • Once assigned (when the row is first inserted into the database) , it never changes until the row is deleted or the table is dropped.
  • The ROWID consists of the following three components, the combination of uniquely identifies the physical storage location of the row.
  • ROWID is automatically generated unique id of a row and it is generated at the time of insertion of row.
  • The ROWID is used internally in indexes as a quick means of retrieving rows with a particular key value.
  • Application developers also use it in SQL statements as a quick way to access a row once they know the ROWID

Example of ROWID

SELECT ROWID, last_name

FROM employees

WHERE department_id = 20;