let the no of ball pens be x and no of gel pens be y
as total no of pens ie,sum of ball pens and gel pens equal 24 ie x+y=24.......(1)
it is given that number of ball pens were 6 less than the no of gel pens tat means x=y-6
x=y-6
sunstituting Y-6 for x in (1)
y-6+y=24
2y-6=24
2y=24+6=30
y=30/2=15
y ,the no of gel pens =15
x=y-6=15-6=9
x the no of ball pens =9
ACTUALLY YOUR QUESTION WAS NOT CLEAR."THE NO OF BALL PENS WAS 6 THEN GEL PENS" THIS SENTENCE WAS REALLY CONFUSING,IT SHOULD HAVE BEEN "6 MORE THAN OR "6 LESS THAN".THAT IS WHY THE PREVIOUS SOLUTION BECAME WRONGG.IT IS NOT HIS FAULT BUT YOUR FAULT.I ASSUMED THE SENTANCE AS"THE NO OF BALL PENS WAS 6 LESS THAN GEL PENS"
THAT IS HOW I SOLVED IT.NEXT TIME PLEASE TYPE YOUR QUESTIONS CLEARLY
THANK YOU.