Well, in my opinion, if others want to compare marks that their choice, not yours. If however you don't want to tell them what you got, then you don't have too (though some teachers post up everyone marks for everyone to see).
I always used to compare marks with people at school, because, I think its interesting to get an idea of how you are going compared with your peers.
If they keep bragging to you about how they got 100% in the exam and you can't deal with it, just tell em you don't care how they went.
This is more of a personal thing, so I can't really comment, but if they do good then shouldn't you be happy for them doing so well...
I think its kind if someone asks you how you went, because it shows they take a slight interest in their peers.