3i Infotech Papers: Sample Questions 1002 - 1004 of 1245

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

Question number: 1002

» Basic CS » Data Structures



You are creating a Index on EMPNO column in the EMPLOYEE table. Which statement will you use?


Choice (4) Response


CREATE emp_empno_idx INDEX ON employee (empno)


CREATE INDEX emp_empno_idx ON employee (empno)


CREATE INDEX emp_empno_idx FOR employee, empno


CREATE INDEX emp_empno_idx ON employee, empno




CREATE INDEX emp_empno_idx ON employee (empno) statement creates a Index on EMPNO column in the EMPLOYEE table.

Question number: 1003

» Languages » Assembly Language

Short Answer Question▾

Write in Short

What is a program counter? What is its use?


  • Program counter register contains the address of the instruction after currently executing instruction.

  • As instructions get fetched- program counter increases its stored value by .

  • Program counter pointes to the next instruction in the sequence.

  • It speeds up the execution of a task.

Question number: 1004

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

How would you use the functions memcpy (), memset (), memmove ()?


  • memcpy ()

    • Copies bytes of data between memory blocks- called buffers.

    • Doesn’t care about the type of data being copied.

    • Simply makes an exact byte-for byte copy.

    • The function declaration is

      • void * memcpy (void * dest, void * src, size_t count);

      • Arguments dest and src point to the destination and source memory blocks.

      • Count specifies the number of bytes to be copied.

  • Memmove ()

    • Copies a specified number of bytes from one memory block to another.

    • More flexible, as it can handle overlapping memory blocks- can do everything memcpy () can with flexibility of dealing with overlapping blocks.

    • The function declaration is

    • Void * memmove (void * dest, void * src, size_t count);

    • Dest and src point to destination and source memory blocks

    • Count specifies the number of bytes to copied.

    • The return value is in dest.

  • Memset ()

    • To set all the bytes in a block of memory to a particular value, use memset ()

    • memset () initializes a block of memory to a specified value.

    • Void * memset (void * dest, int c, size_t count);

    • Dest points to the block of memory.

    • C is of type int but treated as a type char-, only the low-order byte is used, and we specify values of c only in the range 0 through 255.

  • Function useful only with type char- useful for blocks of data types other than char only when they are to be initialized to 0.