"how did you do" will be printed, since nothing in the if/else match 100.
I appear to have missed that.
It might be a kind of "educational pseudocode".
my first thought was C++, but with macros that change things- macros for and to be &&, endif = }, cin >> = input, cout << = input, etc. Sadly, you see that type of thing all the time, and it doesn't make a whole lot of sense. If you want to teach a language that uses, for example, endif, then use such a language, don't just hodgepodge a bunch of C++ macros to do it that way.
Oh well.
The only problem is that there is no starting brace for the if blocks if that was the case.
I'd definitely have to say it's some sort of psuedocode as well.
A Google search showed that very same assignment was posted on justanswer.com's "Ask a Homework Question, Get an Answer ASAP!" service, "790 days and 19 hours ago.". (You have to pay to see the answer - 3 UK pounds)
I would have suspected as much. It's not like it's particularly difficult- it involves more math concepts then it does programming concepts. Although it's a lot better then the trivia-related questions both in classes as well as as interview question. Stupid, retarded questions that essentially test ones knowledge of a few language corner cases, like "Is it possible for a function to return more often than it is called?" or how does the XXX keyword work, or other nonsense. It's pointless to ask such questions- you're trying to make/find programmers, not people who read and memorize language references. You want to find somebody who won't sit around testing out a certain programming construct or modifier to see what it does and will instead actually defer to the language reference to find out; a question like:
what is the output from
2["hello"]
and why?
Is a completely stupid question. First off, is it really that important that they know how to deal with such trivial corner cases? Sure, it proves they have a handle on pointers, but it also proves that they are willing to make "clever" code when it's not necessary, and their code is probably strewn with ternary conditionals. "clever" code is bad and difficult to read. Clever interview questions are bad because they encourage clever code.