3i Infotech Papers: Sample Questions 436 - 437 of 1245

Examrace Placement Series prepares you for the toughest placement exams to top companies.

Question number: 436

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

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. }

Explanation

Here value is 7

In the program

Table shows 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 number: 437

» Database » MySQL

Essay Question▾

Describe in Detail

What is ROWID?

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;