Languages [3i Infotech Placement]: Sample Questions 451 - 452 of 546

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

Question 451

Edit

Describe in Detail

Essay▾

What is the output of the following program?

  1. main ()
  2. {
  3.     externi;
  4.     printf ( “%d”, i);
  5.     {
  6.         inti =20;
  7.         printf ( “%d”, i);
  8.     }
  9. }

Explanation

In the program

Table Shows the Program
extern i;
  • Declare extern variable i
  • The extern keyword means “declare without defining” .
  • This means that the object or function is accessible through this name from other translation units in the program.
printf ( “% d” , i) ;
  • The identifier i is available in the inner block and so using extern has no use in resolving it.

Question 452

Edit

Describe in Detail

Essay▾

What are the functions of RMI, SIM?

Explanation

RIM:

  • Read Interrupt Mask.
  • RIM is a multipurpose instruction used to read the status of interrupts 7.5,6.5,5.5 and to read serial input data bit.
  • Following accumulator with RIM loads 8-bit data.
  • Actually RIM does the following three tasks:
Three Tasks of the RIM

SIM

  • Set interrupt mask instructions provide interrupt services of the 8085 microprocessor with the serial input data and serial output data on the device.
  • This instruction controls hardware interrupt of microprocessor.
  • Provides multipurpose interrupt used to implement the 8085 interrupts (RST 7.5,6.5,5.5) and serial data output.

SIM does the following three tasks:

Three Tasks of the SIM

Developed by: