Searching for "5%"

Q:

A jar was full with honey. A person used to draw out 20% of the honey from the jar and replaced it with sugar solution. He has repeated the same process 4 times and thus there was only 512 gm of honey left in the jar, the rest part of the jar was filled with the sugar solution. The initial amount of honey in the jar was:

A) 1.25 kg B) 1 kg
C) 1.5 kg D) None of these
 
Answer & Explanation Answer: A) 1.25 kg

Explanation:

Let the initial amount of honey in the jar was k, then

 

 512 = k1 - 154 or  512 = k454 

 => k = 512 × 625256 

=> k = 1250

 

 Hence initially the honey in the jar = 1.25 kg

Report Error

View Answer Report Error Discuss

Filed Under: Alligation or Mixture
Exam Prep: CAT , Bank Exams , AIEEE
Job Role: Bank PO , Bank Clerk

Q:

A milkman has 20 liters of milk. If he mixes 5 liters of water, which is freely available, in 20 liters of pure milk. If the cost of pure milk is Rs. 18 per litre, then the profit of the milkman, when he sells all the mixture at  cost price, is:

A) 20% B) 25%
C) 33.33% D) 18%
 
Answer & Explanation Answer: B) 25%

Explanation:

When the water is freely available and all the water is sold at the price of the milk, then the water gives the profit on the cost of 20 litres of milk.

 

  Since,    the profit % = ProfitCostPricex100

Therefore, profit percentage = 520x100  = 25%

Report Error

View Answer Report Error Discuss

Filed Under: Profit and Loss
Exam Prep: AIEEE , Bank Exams , CAT
Job Role: Bank Clerk , Bank PO

Q:

File contains 5 records say D,E,F,C,A-I want to copy D and A records only by using file-aid?

Answer

Go to file-aid copy option.Enter the from dataset to be copied and to dataset to which you want to copy.go to options. Enter 0 at Initial records to skip field.Then enter 3 at the no of records to skip field and 1 to no of records to select.press enter and PF3.

Report Error

View answer Workspace Report Error Discuss

Q:

How do you display last 5 records in DB2?

Answer

SELECT * FROM table_name ORDER BY column_name desc Fetch first 5 rows only;

Report Error

View answer Workspace Report Error Discuss

Q:

Point out the error, if any, in the following program.

#include "stdarg.h"

main()

{

     display ( 4, 12.5, 13.5, 14.5, 44.3);

}

display(int num, ...)

{

       float c; int j;

        va_list ptr;

        va_start (ptr, num);

        for ( j = 1; j <= num; j++)

        {

            c = va_arg ( ptr, float );

            printf ("\n%f", c);

         }

}

Answer

While extracting a float argument using va_arg we should have useed 


c = va_arg (ptr, double)

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

Q:

What would be the output of the following program ?

main()

{

     const int x = 5; 

      int *ptrx;

      ptrx = &x;

      *ptr = 10;

       printf ("%d", x);

}

A) 5 B) 10
C) Error D) Garbage value
 
Answer & Explanation Answer: B) 10

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Programming

Q:

Answer the following Program

#define CHARSIZE 8

#define MASK(y) (1 << y % CHARSIZE)

#define BITSLOT (y) (y / CHARSIZE)

#define SET(x,y) ( x[BITSLOT(y)] = MASK(y) )

#define TEST(x,y) ( x[BITSLOT(y)] & MASK(y) )

#define NUMSLOTS(n) ((n + CHARSIZE - 1) / CHARSIZE)

 

Give the above macros how would you

1. declare an array arr of 50 bits

2. put the 20th bit on

3. test whether the 40th bit is on or off

Answer

1. char arr[NUMSLOTS(50)];


2. SET (arr, 20);


3. if (TEST (arr, 40))

Report Error

View answer Workspace Report Error Discuss

Subject: Programming

Q:

If the following structure is written to a file using fwrite(), can fread() read it back successfully?

struct emp

{

    char *n;

    int age;

};

struct emp e = { "Sujay",15};

FILE *fp;

fwrite (&e, sizeof (e), 1, fp);

Answer

No, since the structure contains a char pointer while writing the structure to the disk using fwrite() only the value stored in the pointer n would get written. When this structure is read back the address would be read back but it is quite unlikely that the desired string would be present at this address in memory

Report Error

View answer Workspace Report Error Discuss

Subject: Programming