3i Infotech Papers: Sample Questions 768 - 770 of 1245

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

Question number: 768

» Languages » C & C Plus Plus

Short Answer Question▾

Write in Short

  1. void main ()
  2. {
  3.     char far * farther, * farthest;
  4.     printf ( “%d. %d” sizeof (farther), sizeof (farthest) );
  5. }

Explanation

In a program

Table shows the program

Table shows the program

char far * farther, * farthest;

Here farther’s type-FAR pointer to char

Farthest’s type-near pointer to char

printf (“%d. %d” sizeof (farther), sizeof (farthest) );

Now the difference in size of those stems from the fact that far pointers consist of the segment and offset together, while near pointers just have the offset.

Near pointer thus have size of 2 (just the offset), while far pointers- size of 4 bytes.

Question number: 769

» Languages » C & C Plus Plus

Short Answer Question▾

Write in Short

Char inputString [100] = {0};

To get string input from the keyboard which one of the following is better?

  1. gets (inputString)

  2. fgets (inputString, sizeof (inputString), fp)

Explanation

2nd one is better

Table shows the program

Table shows the program

gets (inputString)

  • gets (inputString) doesn’t know the size of the string passed and so, for very big inputs the characters will be written past the input string causing buffer overflow

fgets (inputString, sizeof (inputString), fp)

  • fgets used with stdin performs the same operation as gets but is safe.

Question number: 770

» Database » MySQL

Short Answer Question▾

Write in Short

What is indexing and what are the different kinds of indexing?

Explanation

  • Indexing is a technique for determining how quickly specific data can be found.

Types:

  • Binary search style indexing

  • B-Tree indexing

  • Inverted list indexing

  • Memory resident table

  • Table indexing