In this program we've broken up the complex operation of saying "Hello World" into two steps:
But this program is simpler than expected. What's happening?
#include <stdio.h>
int main()
{
/* Do the greeting
printf("Hello ");
/* Now identify who we are greeting */
printf("World\n");
return (0);
}
Hint 1:
It looks like there are two std::cout statements in this program.
There are not.
Hint 2: It looks like there are two comments in this program. There are not.
Hint 3: There is only one comment in the program and it's much longer than expected.
Hint 4:
There's a reason we used /* ... */ comments
in this program.
Hint 5:
The compiler complains about seeing a /* in a comment.
Hint 6:
There's a reason we used /* ... */ comments comment
in this program.
Answer: The first comment is not closed. As a result we have one big comment in the middle of the program which engulfs the print line that follows.
#include <stdio.h>
int main()
{
/* Do the greeting
printf("Hello ");
/* Now identify who we are greeting */
printf("World\n");
return (0);
}