0

C Programming - 1

Description: Miscellaneous C Programming - 1
Number of Questions: 23
Created by:
Tags: Miscellaneous C Programming - 1 Basic Fundamentals Hardware and Software C Language Fundamentals of Computer Programming
Attempted 0/23 Correct 0 Score 0

Which of the following is not a control statement?

  1. SELECT CASE

  2. single-alternative block IF

  3. double-alternative block IF

  4. END


Correct Option: D

Which of the following is the correct order of the categories of computers from the largest to the smallest?

  1. Supercomputer, microcomputer, mainframe, minicomputer

  2. Mainframe, minicomputer, supercomputer, microcomputer

  3. Supercomputer, mainframe, minicomputer, microcomputer

  4. Mainframe, supercomputer, minicomputer, microcomputer


Correct Option: C

_______ statement(s) allow the programmer to change the flow of program execution.

  1. Inquiry-and-response

  2. Print

  3. Control

  4. Flowcharting


Correct Option: C

The last statement in a block IF is always _______.

  1. END

  2. END BLOCK

  3. ELSEIF

  4. END IF


Correct Option: D

What occurs if the first statement after a block IF statement is non-executable such as a REM statement?

  1. An error message is displayed.

  2. The program will execute the statement immediately before the block IF statement.

  3. The block IF statement is executed again.

  4. The first statement following the non-executable statement is executed.


Correct Option: D

A _______ always contains an ELSE clause.

  1. single-alternative block IF

  2. double-alternative block IF

  3. SELECT CASE

  4. menu


Correct Option: B

A _______ displays a list of program functions from which the user can choose one.

  1. collating sequence

  2. boolean operator

  3. menu

  4. relational operator


Correct Option: C

In a double-alternative block IF statement, _______.

  1. Both THEN and ELSE clauses may be executed

  2. ELSE clause is always executed

  3. Either THEN or ELSE clause will be executed

  4. THEN clause is always executed


Correct Option: C

Which of the following is an invalid example of a numeric constant?

  1. 14.85

  2. 98

  3. – 1890

  4. $75


Correct Option: D

The block IF statement uses relational operators to compare _______.

  1. constants, variables, and arithmetic expressions

  2. relational symbols and characters only

  3. constants and relational operators

  4. characters and arithmetic expressions only


Correct Option: A

Which of the following is an invalid character string constant?

  1. “It is a gift to be simple”

  2. ‘Every day with you”

  3. “There was an old lady who”

  4. “Everybody likes computers”


Correct Option: B

What happens when a string variable is compared to a numeric variable?

  1. The variables are compared character by character until one of the values is different.

  2. The variables are ignored.

  3. An error will occur.

  4. The second variable is automatically changed to the data type of the first variable.


Correct Option: C

The _______ statement can be used to clear the output screen of any garbage before displaying program output.

  1. NEW

  2. ERASE

  3. CLS

  4. PRINT


Correct Option: C

The number + 10,345.8 is an invalid numeric constant because it _______.

  1. contains a comma

  2. contains a plus sign

  3. has a decimal point

  4. is too large


Correct Option: A

Which of the following is an invalid numeric variable name?

  1. Nme$

  2. Sum.Total

  3. Number

  4. Largest


Correct Option: A

The statement LET Print = X + Y + Z is invalid because _______.

  1. the variable Print must be a string variable

  2. the variables X, Y, and Z must end with a percent (%) sign

  3. print is a keyword

  4. the word LET must be eliminated


Correct Option: C

Which of the following is an invalid numeric variable name?

  1. NumPeople

  2. Num.People

  3. Num_People

  4. NUMPEOPLE


Correct Option: C

Variable names must begin with a _______.

  1. special symbol or letter of the alphabet

  2. letter of the alphabet

  3. number or letter of the alphabet

  4. special symbol


Correct Option: B

Which of the following is a valid string variable name?

  1. St

  2. Nme%

  3. Address$

  4. Zip Code$


Correct Option: C

_______ can be used to control the order in which arithmetic operations will be performed.

  1. Periods

  2. Quotation marks

  3. Parentheses

  4. REM statements


Correct Option: C

A literal can consist of _______.

  1. only numbers

  2. only letters of the alphabet

  3. any combination of numbers, letters, and/or special characters

  4. only special characters such as &


Correct Option: C

When the condition evaluates as true in a block IF statement, which part of the statement is executed?

  1. None; the statement is skipped.

  2. The THEN part of the statement is executed.

  3. The ELSE part of the statement is executed.

  4. Both the THEN and the ELSE parts of the statement are executed.


Correct Option: B

Which statement best describes this LET statement? LET Sum = N1 + N2 + N3

  1. '*** Print the sum of the 3 numbers. ***

  2. '*** Find the product of the 3 numbers. ***

  3. '*** Copy the value of N1 to sum. ***

  4. '*** Find the sum of the 3 numbers. ***


Correct Option: D
- Hide questions