3i Infotech Placement: Sample Questions 318 - 319 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 318

Edit

Describe in Detail

Essay▾

What is a trap and trapdoor?

Explanation

Image Shows the TRAP
Image Shows the Trap Door

Trap

  • Trap is a software generate interrupt.
  • Occurs when some exceptional conditions occurs- like divide by 0, process accessing memory outside address space.
  • There are two kinds of traps- hard traps are called interrupts, and software related traps are called exceptions.

Trap Door

  • Trap door in modern terminology has nothing to do with traps.
  • It is a secret undocumented entry point into a program granting access without normal authentication.
  • Generally maliciously- hidden software mechanism allowing the attacker to circumvent the security.
  • Malicious code can then allow unauthorized access to a computer system or network accepting remote commands.
  • Code listens for commands on transmission control protocol or user datagram protocol.

Question 319

Edit

Describe in Detail

Essay▾

What is the output of the following program?

  1. main ()
  2. {
  3.     chara[100];
  4.     a[0] =‘a’ a[1] =‘b’ a[2] =‘c’ a[4] =‘d’ ;
  5.     abc (a);
  6. }
  7. abc (chara[])
  8. {
  9.     a ++;
  10.     printf ( “%c” ⚹a);
  11.     a ++;
  12.     printf ( “%c” ⚹a);
  13. }

Explanation

In the program

Table Shows the Program
char a [100] ;Declare the character array a [100] ;
a [0] = ‘a’ a [1] = ‘b’ a [2] = ‘c’ a [4] = ‘d’ ;Define the characters in the array.
abc (a) ;Applying abc (a) function
abc (char a [] )

{

a ++ ;

printf ( “% c” ⚹ a) ;

a ++ ;

printf ( “% c” ⚹ a) ;

}

In the abc () function

First the base address is modified only in function and as a result ‘a’ points to ‘b’ then after incrementing to ‘c’ .

So, bc will be printed.

Developed by: