# C Programming

## Quiz by ibrahim shabbir (SGA)

### Our brand new solo games combine with your quiz, on the same screen

Correct quiz answers unlock more play!

20 questions
• Q1

In the problem-solving process, the step during which a solution is divided into sub solutions and arranged in proper order to solve the problem is

analyzing the problem

planning the solution of the problem

defining the problem

selecting the solution of the problem

45s
• Q2

Consider the given algorithm

Step 1: Start

Step 2: INPUT A

Step 3: IF A> 0 THEN GOTO Step 4 ELSE GOTO Step 7

Step 4: A = A -1

Step 5: PRINT A

Step 6: GOTO Step 3

Step 7: Stop

If the input is 5, then the output of this algorithm is

4 3 2 1 0

4 3 2 1

5 4 3 2 1

5 4 3 2 1 0

45s
• Q3

Consider the given algorithm

Step 1: Start

Step 2: A = 5, B = 10, C =15

Step 3: X = A + B + C

Step 4: Y = X / 3

Step 5: Output Y

Step 6: Stop

The output of the given algorithm will show the

division of three numbers

sum of three numbers

average of three numbers

largest number from three numbers

45s
• Q4

In the problem-solving process, the step during which the number of possible solutions is determined is

selecting the solution of the problem

defining the problem

analysing the problem

planning the solution of the problem

45s
• Q5

Which of the following are used to indicate the start of multiple line comments in a C program?

Forward Slash and Asterisk

Backward Slash and Asterisk

Forward Slash and Number sign

Backward Slash and Number sign

45s
• Q6

If the main function returns the integer value but it does not have any arguments, then it is written as

int main (void)

int main (int)

void main (int)

void main (void)

45s
• Q7

How many types of  typecasting are there in C programming language?

three

five

two

one

45s
• Q8

The CORRECT categorization of built-in function based on preprocessor directives is

# include <stdio.h>

printf()

#include<conio.h>

scanf()

# include <stdio.h>

printf()

#include<conio.h>

clrsrc()

# include <stdio.h>

clrsrc()

#include<conio.h>

getch()

# include <stdio.h>

getch()

#include<conio.h>

scanf()

45s
• Q9

Examples of unary operators are

I. !

II. ++

III. %

IV. ||

I and III

I and II

III and IV

II and IV

45s
• Q10

An example of compound assignment operators is

!=

==

=

%=

45s
• Q11

Which of the following C code will CORRECTLY input two values?

int x, y;

scanf("&f &f", %x, %y):

float x, y;

scanf("%f %f", x, y):

float x, y;

scanf("%f %f", &x, &y):

int x, y;

scanf("f, f", &x, &y):

45s
• Q12

Consider the given C statement.

If ((a % 2 == 0) && (a % 3 == 0))

This statement will be TRUE when the value of variable a is

10

14

12

16

45s
• Q13

If more than two conditions need to be tested, then the conditional statement(s) that should be used is/are

I. If statement

II. If-Else statement

III. If -Else- If statement

I and II

I only

II and III

III only

45s
• Q14

Consider the given program

#include<stdio.h>

int main()

{

int n;

for ( n = 10; n > 1; n--)

{

printf("%d" , n);

}

return 0;

}

The output of this program is

10 9 8 7 6 5 4 3 2

2 3 4 5 6 7 8 9 10

10 9 8 7 6 5 4 3 2 1

1 2 3 4 5 6 7 8 9 10

45s
• Q15

Which of the following loop statements should be used in this program to repeat the code inside the loop body 3 times?

for (n = 3; n > 1; n++)

for (n = 1; n < 3; n++)

for ( n = 1; n++ < 6; n++)

for (n = 1; n++ > 6; n++)

45s

Teachers give this quiz to your class