0% found this document useful (0 votes)
13 views3 pages

Computer 10 Pre-Board.

Uploaded by

Peace Despiro
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)
13 views3 pages

Computer 10 Pre-Board.

Uploaded by

Peace Despiro
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/ 3

Roll No. Answer Sheet No.

Sig. of Candidate. Sig. of invigilator.

COMPUTER SCIENCE CLASS 10

SECTION A (Marks 13)


NOTE:Section 'A' is compulsory. All questions carry equal marks. Select the choice which you think is correct with Marker or Pen
ink.Deleting / overwriting is not allowed.Do not use a lead pencil.
Q. 1 A _____ loop is a loop within another loop. (1)

A. for B. while C. do-while D. nested

Q. 2 A _____ loop is used to execute a set of statements repeatedly for a fixed number of times. (1)

A. for B. do while C. while D. nested

Q. 3 Which of the following selection structures tests only for equality? (1)

A. if statement B. if-else statement C. else-if statement D. switch statement

Q. 4 _____ can be used instead of a switch statement. (1)

A. if statement B. if-else statement C. if-else-if statement D. conditional operator

Q. 5 Which of the following is used at the beginning and the end of a for loop if it consists of more than one statement? (1)

A. ( ) B. < > C. [ ] D. { }

Q. 6 Which of the following will be printed when the given code is executed? (1)

A. value of x is 1 B. x is a positive number C. It will give an error. D. nothing will be printed

Q. 7 Which of the following structure enables a programmer to execute a set of instructions repeatedly until a particular (1)
condition is met?

A. selection B. sequence C. choice D. loop

Q. 8 In a situation where there are only two choices based on a condition, which of the following statement is suitable (1)
to use?

A. if statement B. if-else-if statement C. if-else statement D. switch statement

Q. 9 The case block ends with _____. (1)

A. end select B. end case C. break D. case close

Q. 10 A pass through a loop is called _____. (1)

A. execution B. iteration C. enumeration D. culmination

Q. 11 A _____ is also called as counter loop. (1)

A. do-while B. for C. while D. if-else

Q. 12 A _____ loop is used when it is required to execute a loop at least once. (1)

A. for B. do while C. while D. nested

Q. 13 Which of the following loop is preferred when the number of times the loop will execute is not known in advance? (1)

A. for loop B. do while loop C. while loop D. nested loop

Powered by Knowledge Platform


SECTION B (Marks 44)
NOTE:Attempt all questions from Section 'B'. All questions carry equal marks. Write your answers neatly and legibly.
Q. 1 Write down the output for the following code. (2)

Q. 2 Write down the following statement using a conditional operator. (2)


if (x > y)
z = (x + y)/3;

else
* ;
z = x − 5 y

Q. 3 Define nested selection structure. (2)

Q. 4 Write down the difference between while loop and do-while loop. (2)

Q. 5 Write down the output for the following code. (2)

Q. 6 Write down the difference between else-if and switch selection structures. (2)

Q. 7 Write down the difference between for loop and while loop. (2)

Q. 8 Rewrite the following program using switch statement: (2)


void main(void)
{
char grade;
printf("\n Enter the grade of a student from A-C");
if(grade=='A' ∣∣ grade=='a')
printf('\n Excellent");
else if (grade=='A' ∣∣ grade=='b')
printf("\n Well done");
else if (grade=='C'∣∣ grade=='c')
printf("\n poor performance");
else
printf("\n Invalid Letter");
getch()
}

Q. 9 Write down the output of the following code> (2)


int n, count, sum;
n=28; count=15; sum=30;
if (n<25)
{ count=count+5
printf("\nCount=%d", count); }
else
{ count=count-5;
sum=sum+n;\
printf("\nCount=%d",count);
printf(\nSum=%d",sum); }

Q. 10 Write down the following statement using if-else statement. (2)


k= (a + b > 20)?a + 3*; a − b;

Powered by Knowledge Platform


Q. 11
Write down the difference between if and if-else selection structures. (2)

Q. 12 Write down the output of the following code. (2)

Q. 13 Determine the output of following C program: (2)

int n,sum=0;
for (n=1; n<=10; n+2)
{
sum=sum+n
printf("%d\t",n)
}

Q. 14 Compare while & do-while loops. (2)

Q. 15 Convert the following for loop into a while loop. (2)

Q. 16 Find the errors in the following code. (2)

SECTION C (Marks 40)


NOTE:Attempt all questions from Section 'C'. All questions carry equal marks. Write your answers neatly and legibly.
Q. 1 What is a looping structure? Explain for loop, with example. (4)

Q. 2 Define nested loop. Write down an example for a nested loop. (4)

Q. 3 Explain while and do-while loops with examples. (4)

Q. 4 Write down the algorithm for the series given below, with the help of the program formulated for it to compute and print (4)
sum using 'for loop' statement.
2 3 n
x + x + x +. . . + x

Q. 5 What is the purpose of a switch statement? Also, write a program to demonstrate the use of a switch statement. (4)

Q. 6 Define control structure and conditional statement. (4)

Q. 7 Write a program to compute and print sum of the following series using for loop statement. (4)
2 3 n
x + x + x +. . . + x

Powered by Knowledge Platform

You might also like