Here is a collection of if and if-else statements with semicolons in various places. Assume all variables have been declared and initialized. Which of these are correct and are likely to give the programmers intent? Which are correct but unlikely to give the programmer's intent? Give the error for the remaining.

a) if ( a > b );
a = b;
else
b = a;
b) if(a > b )
a = b;
else;
b = a;
c) if(a > b )
a = b;
else
b = a;
d) if(a > b)
a = b
else
b = a;
e) if( x !=0 )
a = a / x

c) is correct and is likely to be the programmer’s intent. b) compiles but is
unlikely to be the programmer’s intent.

Computer Science & Information Technology

You might also like to view...

To view exactly which formats are applied to the character, paragraph, and section of selected text, which of the following should be done?

a. Use the Reveal Formatting task pane. b. Use the Smart Lookup pane. c. Use the Navigation pane. d. Use the Researcher pane.

Computer Science & Information Technology

The first argument needed for the IRR function is a(n) ________

A) number that represents months B) interest amount C) range D) investment amount

Computer Science & Information Technology