3i Infotech Placement: Sample Questions 591 - 593 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 591

Write in Short Short Answer▾

What are stand-alone procedures?

Edit

Explanation

  • A procedure which is not enclosed in a package is called Stand Alone Procedure.
  • A standalone procedure is a procedure (a subprogram that performs a specific action) that is stored in the database.
  • Ex- one written in a SQL ⚹ Forms application.
  • Limitation: Not available for reference from other Oracle tools.
  • Limitation: Are compiled at run time, which slows execution.

Question 592

Question MCQ▾

  1. Declare
  2. a number := 5;
  3. b number := null;
  4. c number := 10;
  5. Begin
  6. if
  7. a >b AND a <c
  8. then
  9. a := c a;
  10. end if;
  11. End;

What will be the value of ‘a’ after execution?

Choices

Choice (4)

a.

5

b.

50

c.

NULL

d.

None of the above

Edit

Answer

a.

Explanation

NULL values cannot be compared like normal values, a comparison with null always returns false and hence the value of ‘a’ remains unmodified.

Question 593

Write in Short Short Answer▾

What is the output of the following program?

  1. main()
  2. {
  3. int i =0;
  4. while (+(+i--)! =0)
  5. i=i ++;
  6. printf (“%d”,i);
  7. }
Edit

Explanation

In the program

Table Shows the Program
int i = 0
  • Define the integer variable i = 0
while (+ (+ i-) ! = 0)
  • Unary + is the only dummy operator in C.
  • So it has no effect on the expression and now the while loop is:
  • While (+ (+ i-) ! = 0)

    i = 0

  • So 0! = 0 is false hence condition for while fails.
  • Now there is also a post decrement operator.
printf ( “% d” , i) ;
  • Value of i turns out to be -1. And that is which is printed.