Professional Documents
Culture Documents
Computer Programming 1
I. Multiple Choice
Write the correct answer from among the choices
d. all of these
12. In flowchart the entrance and exit of data is represented by the symbol
a. Rectangle b. diamond
c. parallelogram d. small circle
16. In C++, what is the term for a named set of statements that perform tasks
a. main() b. void ( )
c. proc() d. function ()
17. Which of the following is true about the use of identifiers in C++
a. C++ allows the use of digits at the beginning of an identifier
b. C++ identifiers may contain spaces between them
c. C++ identifiers may contain reserved words.
d. The case used in C++ identifiers must be consistent throughout the program.
23. How would you round off a value from 1.66 to 2.0?
A. ceil(1.66) B. floor(1.66)
C. roundup(1.66) D. roundto(1.66)
25. Translator which is used to convert codes of assembly language into machine
language is termed as
a. assembler b. attempter
c. compiler d. debugger
26. Language in which single statements can be written to accomplish substantial tasks
is termed as
a. machine language b. assembly language
c. high level language d. medium language
28. Data type is shifted from short type to long type when
a. value range decreases b. value range increases
c. value range becomes zero d. value range become infinite
29. Dividing a program into functions and modules is one of main feature of
a. machine language b. interpreted language
c. structural language d. all of these
II
1: Write a C++ program which accepts three numbers x, y and z and compute the
following algebraic expression:
𝑟𝑒𝑠𝑢𝑙𝑡=2𝑥+𝑦𝑧−2
Sample Output:
Result is : 32
2: Write a C++ program which accepts total number of days and converts it into
years, months, weeks and days. Use 365 days = I year
Sample Output: