3i Infotech Papers: Sample Questions 218 - 220 of 1245

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

Question number: 218

» Database » MySQL

Short Answer Question▾

Write in Short

Which command executes the contents of a specified file?

Explanation

  • START or@command executes the contents of a specified file.

  • Script can only called from a url.

Question number: 219

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

  1. main ()
  2. {
  3.     int i;
  4.     printf ( “%d” scanf( “%d” &i) );//value 10 is given as input here
  5. }

Explanation

  • In a program

    Table showning the program

    Table showning the program

    int i;

    Define integer variable i

    printf (“%d” scanf (“%d” &i) ); //value 10 is given as input here

    Here scanf returns number of items successfully read and not 10.

    Here 10 is given as input.

    This should have been scanned successfully.

    So, number of items read is 1.

  • So. The answer is 1.

Question number: 220

» Languages » C & C Plus Plus

Essay Question▾

Describe in Detail

  1. main ()
  2. {
  3.     float me = 1.1;
  4.     double you = 1.1;
  5.     if (me = = you)
  6.     printf ( “I love U” );
  7.     else
  8.     printf ( “I hate U” );
  9. }

Explanation

  • For floating point numbers (float, double, long double) the values cannot be predicted exactly

  • Float takes 4 bytes

  • Double and long double takes 10 bytes

  • So, float stores 0.9 with less precision than long double.

  • So in the program

    Table shows the program

    Table shows the program

    float me = 1.1

    Define float value

    double you = 1.1

    Define double value

    if (me == you)

    Apply if condition for float and double value

  • Float me = 1.1 and double you = 1.1 is not same

  • So, apply the else condition and print I hate U

  • Rule of Thumb: Never compare when using floating point numbers with relational operators (==, > < ⇐ > =, =).