ST Microelectronics Papers: Sample Questions 20 - 22 of 40

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

Question number: 20

» Aptitude

Short Answer Question▾

Write in Short

What will be the output of the following program?

  1. charstr= “hello neha”;
  2. printf(“n%s”,str);

Explanation

  • Compilation error
  • Here, str is defined as a character variable. Any character variable can store only one character at a time. So there will be compilation error in the output.
  • If we want to store more than one character in a character variable then either we can declare an array with indeterminate size and assign the string literal to the array as it is declared or with use of pointers. Since the string literal already be in memory when we run the application, we can just point to it.

Question number: 21

» Aptitude

True-False▾

Question

Is the Following Statement True or False?

All chickens lay eggs

Answer

FALSE

Explanation

  • No all chickens don’t lay eggs. Roosters are among them. Only hens will lay eggs. Hens will lay eggs just as well in the absence of roosters. If roosters are present, however, the eggs may be fertilized.
  • Some chickens lay less eggs than others. For instance, decorative breeds and meat breeds will not lay as many eggs as chickens bred for their eggs. Also, older hens will gradually lay less and less eggs as they age.

Question number: 22

» Aptitude

Short Answer Question▾

Write in Short

In POP operation of Microprocessor how it process the instruction

Explanation

It retrieves the instruction and decrements the stack pointer

Stack:

The meaning of the word stack is pile or heap. The simplest way to implement a stack in memory is by using an array. In the study of microprocessor, it is basically defined as the group of memory locations, used for the temporary storage of data. It’s functioning consist of basically two phases i. e. reading and writing memory.

SP:

Stack Pointer is 8 bit register which store value of top of the stack and by default stack pointer contain 07h.

It used the stack memory whenever there is a need to save the contents of program counter during the process of execution of subroutines. Basically we can apply only two operations on stack.

  1. PUSH

  2. POP

PUSH:

It is used to store data into stack.

Using push operation stack pointer increased first and then content of register or memory will store on that stack location which stored in SP.

After completion of execution of PUSH instruction stack pointer is increased by two.

POP:

It is used to retrieve data from stack.

POP operation is reciprocal of push operation. In POP Operation the data from the stack memory is retrieved or received back in the register pair from which it was first saved from the stack memory. In this retrieve data first and then stack pointer decreased by one.

After completion of execution of POP instruction stack pointer is decreased by two.