0% found this document useful (0 votes)
2 views6 pages

C_Programming_Quiz_Answers

The document contains a C programming quiz with multiple-choice questions covering various topics such as program structure, control structures, syntax errors, and output predictions. Each question presents options related to fundamental concepts in C programming. The quiz aims to test the understanding of key programming principles and syntax.

Uploaded by

malakmahamad376
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)
2 views6 pages

C_Programming_Quiz_Answers

The document contains a C programming quiz with multiple-choice questions covering various topics such as program structure, control structures, syntax errors, and output predictions. Each question presents options related to fundamental concepts in C programming. The quiz aims to test the understanding of key programming principles and syntax.

Uploaded by

malakmahamad376
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/ 6

C Programming Quiz - Questions and Answers

1. The structure of the program consists of

• a) Control structures
• b) Modularization
• c) Data declaration
• d) All of the above
2. The loop and process selection are

• a) Control functions
• b) Control structures
• c) Decision makers
• d) Built-in functions
3. The S.E.E is

• a) A structured environment
• b) A traditional language
• c) A structured programming method
• d) A control structure
4. When an algorithm is written in the form of a program, it is called

• a) Structured coding
• b) Code translation
• c) Implementation
• d) Instruction
5. When a reserved word is misused, it causes a

• a) Logical error
• b) Runtime error
• c) Syntax error
• d) Compilation error
6. In C programming, semicolon (;)

• a) Is used to separate values


• b) Is used to identify variables
• c) Is used to indicate the end of a statement
• d) Is not used

7. The output of the following program is:

int func(int x) {
int sum = 0;
while (x != 0) {
sum += x % 10;
x = x / 10;
}
return sum;
}

For func(123);

• a) 3
• b) 5
• c) 6
• d) 9

8. The output of the following program is:

int main() {
int i = 3;
printf("%d", ++i);
return 0;
}

• a) 3
• b) 4
• c) 5
• d) 6
9. The valid expression in C evaluates to true:

• a) x + y > z
• b) x & y < z
• c) x > y && y > z
• d) x < y > z

10. The output of the following program is:

int a = 10;
int b = 20;
int c;
c = a;
a = b;
b = c;
printf("%d %d", a, b);

• a) 10 10
• b) 10 20
• c) 20 10
• d) 20 20
11. The structure of a C program consists of:

• a. header file
• b. main function
• c. statement and return
• d. all of the above
12. Array and pointers are:

• a. primitive data types


• b. Derived Types
• c. User Defined Data Types
• d. basic data types
13. The && is:

• a. arithmetic operators
• b. Relational Operators
• c. Logical Operator
• d. Assignment Operators

14. When we give a value for a variable, this is called:

• a. variable definition
• b. variable initialization
• c. variable announce
• d. global variable

15. abc is an incorrect variable name_13 .5 because of:

• a. it begins with a number


• b. it contains a white space
• c. it should be in capital form
• d. all of the above

16. In C programming, constants are:

• a. read-only values that cannot be modified during the execution


• b. values that can be modified during the execution
• c. can be of various types
• d. a & c
17. The missing part in the following program is:

#include <stdio.h>
int main() {
int n;
Scanf(n);
printf("%od", n);
return 0;
}

• a. "%d"
• b. %d
• c. sn
• d. a & e
18. The missing part in the following program is:

#include <stdio.h>
int main() {
int i = 10;
if (i > 15)
printf("10 is greater than 15");
printf("I am Not in if");
}

• a. {}
• b. scanf statement
• c. return 0
• d. a & c
19. The switch expression should evaluate to:

• a. integer data type


• b. character data type
• c. a & b
• d. all data types
20. The output for the following program is:

int main() {
int i = 15;
if (i = 30) {
if (i < 15)
printf("i is smaller than 15\n");
if (i < 12)
printf("i is smaller than 12 too\n");
else
printf("i is greater than 15");
} else {
if (i = 20) {
if (i < 22)
printf("i is smaller than 22 too\n");
else
printf("i is greater than 25");
}
printf("welcome i");
}

• a. welcome i
• b. i is smaller than 15
• c. i is smaller than 12 too
• d. a & c

Turk <3”

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy