What are you looking for? Letâ€™s dig in quickly

## Explanation

- A pineapple costs Rs. 7 each.

- A watermelon costs Rs. 5 each.

- X spends Rs. 38 on those fruits.

Let suppose â€śpâ€ť denotes pineapple and â€śwâ€ť denotes watermelon.

Now;

7p + 5w = 38

7p = 38 â€“ 5w

p = (38 â€“ 5w)/7

Clearly, p is a whole number only when (38 â€“ 5w) is divisible by 7. This happens when w = 2 (and p = 4).

## To Find

Number of pineapples purchased = ?

## Solution

Let suppose â€śpâ€ť denotes pineapple and â€śwâ€ť denotes watermelon.

Now according to the given condition;

7p + 5w = 38

7p = 38 â€“ 5w

p = (38 â€“ 5w)/7

Suppose w = 0

p = (38 â€“ 0)/7 = 38/7 (p is not a whole number here)

Suppose w = 1

p = (38 â€“ 5)/7 = 33/7 (p is not a whole number again)

Suppose w = 2

p = (38 â€“ 10)/7 = 4 (thatâ€™s the result we want)

Number of pineapples purchased = **4 answer**

## Conclusion

A pineapple costs Rs. 7 each. A watermelon costs Rs. 5 each. X spends Rs. 38 on those fruits. The number of pineapples purchased are 4.