0% found this document useful (0 votes)
10 views7 pages

BCP MCQ

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views7 pages

BCP MCQ

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

BCP MCQ

UNIT 1:- FLOWCHART AND ALGORITHM


1. Which symbol is commonly used to represent a decision in a flowchart?
A) Oval
B) Rectangle
C) Diamond
D) Parallelogram

2. An algorithm is:
A) A coding language
B) A graphical representation of a process
C) A step-by-step procedure for solving a problem
D) A computer program.

3. In flowcharts, the parallelogram symbol represents:


A) Decision-making
B) Input or output
C) Processing
D) Start or end.

4. Which of the following is an advantage of algorithms?


A) Clear step-by-step instructions
B) Speed up computer processing
C) Reduce programming language complexity
D) Provide a finished product.

5. A flowchart is used to:


A) Display the layout of a network
B) Code a program directly
C) Graphically represent an algorithm or process
D) Analyse data structures
Unit 2: Basics of C
1. Which of the following is a correct syntax to declare an integer variable in C?
A) integer x;
B) int x;
C) var x;
D) float x;

2. Which of the following is not a keyword in C?


A) function
B) int
C) return
D) while.

3. In C, the printf function is used to:


A) Read input
B) Display output
C) Stop the program
D) Create a variable.

4. What is the correct syntax for a single-line comment in C?


A) /* comment */
B) // comment
C) \ comment
D) <!-- comment -->.

5. Which of the following is used to compile a C program?


A) Compiler
B) Interpreter
C) Debugger
D) Linker
Unit 3: Decision Statements and Loop Control Statements
1. The if statement is used for:
A) Making a decision based on a condition
B) Looping
C) Ending a program
D) Declaring variables.

2. Which loop in C guarantees that the loop body will execute at least once?
A) for
B) do-while
C) while
D) none

3. What is the output of the following code?


int x = 5;
if (x > 2) { printf("Hello"); } else { printf("World"); }
A) World
B) Nothing
C) Error
D) Hello

4. Which operator is used for logical AND in C?


A) |
B) ||
C) **
D) &&

5.What keyword is used to exit a loop in C?


A) continue
B) break
C) stop
D) end

Unit 4: Array and Pointers


1. An array is:
A) A single integer
B) A set of if statements
C) A collection of elements of the same data type
D) A collection of elements of different data types

2. Which of the following is the correct syntax to declare an array in C?


A) int array(5);
B) int array[5];
C) array int[5];
D) array[5] int;

3. What is the output of the following code?


int arr[3] = {1, 2, 3};
printf("%d", arr[1]);
A) 1
B) 2
C) 3
D) 0

4. A pointer is:
A) A variable that stores the address of another variable
B) A variable that stores a single integer
C) A collection of functions
D) An output device

5. Which of the following operators is used to access the value stored at the address of
a pointer variable?
- A) &
- B) @
- C) **
- D) *

Unit 5: Functions
1. Which of the following is a valid syntax for a function definition in C?
A) int functionName() { }
B) function int() { }
C) void function { }
D) int { }

2. What is the purpose of the return keyword in a function?


A) To end the function and possibly send a value back to the calling code
B) To take user input
C) To declare a variable
D) To pause the function

3. A function that does not return a value has a return type of:
A) int
B) char
C) void
D) float

4. Which of the following statements about function arguments is true?


A) They must always be integers
B) Functions cannot take more than one argument
C) They are specified in the function’s parameter list
D) They are always arrays

5. What is recursion in C?
A) When a function calls itself
B) A type of loop
C) Declaring multiple variables
D) Creating a data structure

Unit 6: Structure-Union-Files
1. Which of the following is true about a structure in C?
A) It holds only one type of data
B) It can hold multiple types of data
C) It only holds integers
D) It is similar to an array

2. What does a union allow in C?


A) Store different types of data but only one value at a time
B) Store multiple integers
C) Use multiple functions
D) Output data

3. How do you access a member of a structure in C?


A) Using *
B) Using &&
C) Using . (dot) operator
D) Using &

4. Which library function is used to read data from a file?


A) printf
B) fscanf
C) fwrite
D) strcpy

5. What does fopen() function return if it fails to open a file?


A) 0
B) NULL
C) 1
D) EOF
Name: - MALLA ALI MOHAMMAD
DIPLOMA IT SEM 1ST

You might also like