BCA batch 2024 - Introduction to computer and programming in C (1 sem)

Start Quiz

1. Which of the following is a type of programming language?

Assembly language High-level language Machine language All of the above

2. What is the main function of a compiler?

To convert high-level language to machine code To execute a program directly To debug errors To load a program into memory

3. Which symbol represents a decision in a flowchart?

Rectangle Oval Diamond Parallelogram

4. Which data type in C is used to store a single character?

int char float double

5. Which operator has the highest precedence in C?

Parentheses ( ) Addition + Relational operators

6. Which loop is guaranteed to execute at least once?

for while do-while All of the above

7. Which keyword is used to terminate a loop immediately?

continue return exit break

8. How is a two-dimensional array declared in C?

array[10] array[10][10] array[10,10] array{10][10}

9. What is the process of calling a function within itself called?

Iteration Recursion Nesting Redefinition

10. What type of storage class limits the scope of a variable to a block?

auto extern static register

11. What is the correct syntax to declare a structure in C?

struct{var;} {struct var;} struct structure_name { ... }; structure struct_name{ };

12. What is the major difference between structure and union?

In unions, memory is shared among members Structures are slower Unions cannot have functions Structures do not support nesting

13. How do you define a pointer in C?

int var; int *ptr; int ptr&; int ptr;

14. What is the output of printf(" %s ", str); if str = "Hello"?

Error %s Hello

15. What mode opens a file for reading in C?

r w rw rb

16. Which function is used to read a single character from a file?

fgets fscanf fgetc fread

17. What is the purpose of the break statement in a switch-case?

To continue execution To exit the switch To initialize the next case To terminate the program

18. What does the term “formal argument” refer to in a function?

Parameters defined in the function Values passed during a function call Variables outside the function Nested function parameters

19. What is the result of 7 / 2 in C if both are integers?

3.5 3 4 Undefined

20. Which function is used to write to a file in C?

fprintf fprint fwrite fputc
Quiz/Test Summary
Title: BCA batch 2024 - Introduction to computer and programming in C (1 sem)
Questions: 20
Contributed by:
Vivekananda Global University NextGen