Docsity

PROGRAMMING BASICS WITH ANSWERS, Study notes of C programming

Toggle sidebar
bg1
📘 Programming Basics
1. A program is:
A. Hardware component
B. Set of instructions to a computer
C. Memory device
D. Database
Answer: B
2. Programming language is used to:
A. Repair hardware
B. Write instructions for computers
C. Store files
D. Play games
Answer: B
3. Which is a low-level language?
A. Python
B. Java
C. Machine language
D. C++
Answer: C
4. Which is a high-level language?
A. Binary
B. Assembly
C. Python
D. Machine code
Answer: C
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download PROGRAMMING BASICS WITH ANSWERS and more Study notes C programming in PDF only on Docsity!

📘 Programming Basics

1. A program is:

A. Hardware component B. Set of instructions to a computer C. Memory device D. Database Answer: B

2. Programming language is used to:

A. Repair hardware B. Write instructions for computers C. Store files D. Play games Answer: B

3. Which is a low-level language?

A. Python B. Java C. Machine language D. C++ Answer: C

4. Which is a high-level language?

A. Binary B. Assembly C. Python D. Machine code Answer: C

5. The process of finding and fixing errors is:

A. Testing B. Debugging C. Compiling D. Running Answer: B

6. An algorithm is:

A. A program error B. Step-by-step solution to a problem C. A variable D. A compiler Answer: B

7. A flowchart uses symbols to:

A. Store data B. Draw pictures C. Represent program logic D. Execute code Answer: C

8. The start/stop symbol in a flowchart is:

A. Rectangle B. Diamond C. Oval D. Arrow Answer: C

9. The decision symbol in a flowchart is:

A. Circle B. Rectangle C. Diamond D. Parallelogram Answer: C

D. True Answer: C

15. Which is a Boolean value?

A. 10

B. 3.

C. True D. “Yes” Answer: C

16. Assignment operator is:

A. ==

B. =

C. >

D. +

Answer: B

17. Which operator compares values?

A. =

B. +

C. ==

D. *

Answer: C

18. Which is an arithmetic operator?

A. &&

B. +

C. ==

D.!

Answer: B

19. Logical AND operator is:

A. ||

B. &&

C.!

D. ==

Answer: B

20. Output in many languages is displayed using:

A. input() B. print() C. read() D. scan() Answer: B

21. Input from user is taken using:

A. print() B. input() C. show() D. write() Answer: B

22. Which structure executes statements sequentially?

A. Loop B. Selection C. Sequence D. Function Answer: C

23. The IF statement is used for:

A. Repetition B. Selection C. Storage D. Compilation Answer: B

D. Gives error Answer: C

29. Break statement:

A. Ends program B. Skips iteration C. Exits loop D. Restarts loop Answer: C

30. Continue statement:

A. Stops loop B. Skips current iteration C. Ends program D. Deletes variable Answer: B

31. A function is:

A. Variable B. Loop C. Block of reusable code D. Error Answer: C

32. Function that returns value uses:

A. stop B. print C. return D. break Answer: C

33. Parameters are:

A. Inputs to function B. Outputs C. Errors D. Loops Answer: A

34. Arguments are:

A. Function name B. Values passed to function C. Data types D. Operators Answer: B

35. Recursion is:

A. Loop B. Function calling itself C. Error D. Variable Answer: B

36. Syntax error occurs:

A. During running B. During compilation C. After execution D. Never Answer: B

37. Runtime error occurs:

A. Before coding B. During execution C. During typing D. During compiling Answer: B

D. Operator Answer: C

43. Array index usually starts at:

A. 1

B. 0

C. -

D. 2

Answer: B

44. Comment in code is used to:

A. Execute logic B. Explain code C. Store data D. Create loop Answer: B

45. Which symbol is often used for comments (Python)?

A. //

B.

C. /*

D. %%

Answer: B

46. String stores:

A. Numbers only B. Characters/text C. Boolean D. Decimal only Answer: B

47. Concatenation means:

A. Subtract strings B. Compare strings C. Join strings D. Delete strings Answer: C

48. Which symbol means “greater than”?

A. <

B. >

C. ==

D. !=

Answer: B

49. Modular programming encourages:

A. Large single program B. Breaking into small functions C. No functions D. No testing Answer: B

50. Testing a program ensures:

A. Faster typing B. Correctness of program C. More memory D. Bigger code Answer: B