C Programming - 2
Description: Miscellaneous C Programming - 2 | |
Number of Questions: 23 | |
Created by: Karuna Seth | |
Tags: Miscellaneous C Programming - 2 Programming Fundamentals of Computer Programming Basic Fundamentals Hardware and Software |
Which of the following is not a relational operator?
What happens if the variable A is equal to 30 when QBasic executes the following statement? IF A = 32 THEN A = A * 2 END IF
If X = 22, which of the following statements is executed? If X <> 8 THEN PRINT "Stop program" END IF
If X = 7, what happens when the following statement is executed? IF (X + 3) + 5 > 10 THEN PRINT "Answer is correct." END IF
Directions: Use the following program segment:
IF Time < Best THEN PRINT "NEW WORLD RECORD!" ELSEIF Time < Best + 10 THEN PRINT "GOOD RACE" ELSE PRINT "AVERAGE RACE" END IF
If Time equals 120 and Best equals 121, what is output when this statement is executed?
Directions: Use the following program segment:
IF Time < Best THEN PRINT "NEW WORLD RECORD!" ELSEIF Time < Best + 10 THEN PRINT "GOOD RACE" ELSE PRINT "AVERAGE RACE" END IF
If Time equals 130 and Best equals 120, what is output when this statement is executed?
Directions: Use the following program segment:
IF Sex$ = "M" THEN IF Height > 66 THEN IF Weight > 180 THEN PRINT "Try out for the football team." END IF END IF END IF
What happens if the value of Height is 66, Weight 181, and Sex equals M when this statement is executed?
Entering data interactively at the keyboard is called _______.
Directions: Use the following expression. (Height > 20) AND (Tree$ = "Hickory") OR NOT (Tree$ = "Oak")
Which of the logical operators in this expression will be evaluated first?
The _______ statement allows the user to enter data during program execution.
While using an INPUT statement, how many values can be entered at a time?
A semicolon immediately after a prompt in an INPUT statement will cause _______.
When entering more than one value in response to a prompt, each value must be separated by _______.
Directions: Use the following expression. (Height > 20) AND (Tree$ = "Hickory") OR NOT (Tree$ = "Oak")
For which of the following values will the above expression evaluate as false?
Which statement is the best for entering data to programs, where the data changes often?
Directions: Use the following program segment.
SELECT CASE Choice CASE 10 Price = Quantity * UnitPrice CASE 20 Price = Quantity * UnitPrice * 0.95 CASE 30 Price = Quantity * UnitPrice * 0.90 CASE ELSE PRINT "Invalid Choice." END SELECT
What happens if Choice equals 20?
A _______ chart is used to determine how a program’s output will be formatted.
When the user enters the incorrect data in response to an INPUT statement, which of the following statements appears on the screen?
Directions: Use the following program segment:
IF Sex$ = "M" THEN IF Height > 66 THEN IF Weight > 180 THEN PRINT "Try out for the football team." END IF END IF END IF
Which of the following could replace this statement?
By using a(n) _______, you can cause output to be placed in the next print zone.
The _______ is used to separate multiple statements on a single physical line.
Directions: Use the following program segment.
SELECT CASE Choice CASE 10 Price = Quantity * UnitPrice CASE 20 Price = Quantity * UnitPrice * 0.95 CASE 30 Price = Quantity * UnitPrice * 0.90 CASE ELSE PRINT "Invalid Choice." END SELECT
Which of the following statements will cause the price to be 90% of Quantity - UnitPrice?
Directions: Use the following program segment.
SELECT CASE Choice CASE 10 Price = Quantity * UnitPrice CASE 20 Price = Quantity * UnitPrice * 0.95 CASE 30 Price = Quantity * UnitPrice * 0.90 CASE ELSE PRINT "Invalid Choice." END SELECT
What happens if Choice equals 21?