Let be the cost of one pencil x and one pen be y
According to the question
5x+7y=50...(I) (Given)
7x+5y=46....(II)
Equation (i) x 7
35x+49y = 350 ... (iii)
Equation (ii) x 5
35x+25y=230 ...(iv)
Equation (iii) - Equation (iv)
24y=120
y=5 rupees
substituting value y in the equation (ii)
x = 3 rupees