A good answer might be:No. It is plausible that they could be, but it turns out that leading spaces will spoil what is otherwise a fine integer. |
Another ExampleHere is another example, suitable for "copy-paste-and-run." It asks the user for two integers which are to be added together.
Study the program for a while. Notice how the indenting and blank lines
help in displaying how the program is organized.
Here is a sample run of the program:
Enter first integer: 12 Enter second integer: -8 The sum of 12 plus -8 is 4 |
QUESTION 18:A slightly hard question: Write the last statement of the program (the one that does output) without using either of the variables first or second. The output should look the same as before. Click Here after you have answered the question |