Most people want to stay humble when they ace in their examinations, or when they were offered a good job, or when they're called "pretty" or "beautiful" by someone. Well, they are many ways to stay humble when that happens, but you oughtn't reply by saying words that discourage yourself like "Nah, I'm sort of dumb actually." or "NO WAY! I'm the ugliest person you've ever met!" or something like that. It makes you look sillier by saying that. The best way to reply a friend when he/she praises you is by saying "Thank you,________________." and with encouraging words that probably would make your friend feel happy themselves. It annoys me, and most people, when these things happen.
This happens all the time, so it's best you get immune to it instead of swearing under you breath ;)