3i Infotech Placement: Sample Questions 872 - 873 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 872

Question

MCQ▾

What is output for the following program.

  1. #include
  2. main ()
  3. {
  4.     inta[5], i, ⚹ip;
  5.     for (i =0; i<5; i ++ )
  6.     a[i] =i;
  7.     ip =a;
  8.     printf ( “%d” ⚹(ip +3 ⚹sizeof (int) ) );
  9. }

Choices

Choice (4)

a.

5

b.

1

c.

0

d.

None of the above

Answer

d.

Explanation

Table Showing the Program
#include < tdio. h >Standard library function
main ()startup after initialization
int a [5] , i, ⚹ ip;Declare integer array of 5, integer i and ⚹ ip is pointer to an integer
for (i = 0; i < 5; i ++)In for loop increase value of i
a [i] = i;

ip = a;

Array element i is equal to i and ip = a, that is the beginning of the array. Array name is the pointer to first element in the array
printf ( “% d” ⚹ (ip + 3 ⚹ sizeof (int) ) ) ;This would print 3rd value in the array a [] which is 3.

Question 873

Question

MCQ▾

Is it possible to Enable or Disable a database trigger?

Choices

Choice (4)

a.

No

b.

Yes

c.

Question does not provide sufficient data or is vague

d.

All of the above

Answer

b.

Explanation

  • Database triggers are procedures it is stored in the database and activated when specific conditions occur, like adding a row to a table.
  • Supplement the standard capabilities of the database for highly customized database management system.

    Triggers Have Two Distinct Modes

  • Enabled
    • An enabled trigger executes its trigger body if a triggering statement is issued and the trigger restriction.
  • Disabled
    • A disabled trigger does not execute its trigger body and the trigger restriction evaluates to true.
The Two Distinct Modes

Enabling Trigger

  • If we have disabled a trigger on a table and we enable the trigger again.
  • We can do this with the ALTER TRIGGER statement.

    Syntax

  • ALTER TRIGGER trigger_name ENABLE;

    Trigger_name

  • The name of the trigger that is enable.

    Eg

  • ALTER TRIGGER order_before_insert ENABLE;

Disable Trigger

  • Created a Trigger in oracle, we might find that we are required to disable the trigger.
  • we can do this with the ALTER TRIGGER statement.

Syntax

  • ALTER TRIGGER trigger_name DISABLE;

    Trigger_name

  • The name of the trigger to disable.

    Ex

  • ALTER TRIGGER order_before_insert DISABLE;

Developed by: