nearly same solutions,but one gives correct & other one gives wrong answer,what's the problem?

I submitted two solutions for the elevators and stairs problem,the first one which gives wrong answer and the another one which gives correct answer.please help me find out what is the difference between the two.

Order of scanf statements is different :slight_smile:


Also one solution prints new lines while the other doesn’t

does order of scanf and new lines for answer matter?

I changed the scanf order but still it is giving wrong answer

else {printf("Elevator");}

Print a answer on new line. :slight_smile:

tried it.but no use