Saad Academy
Ismail Park, Allied bank, Daroghawala, Lahore
Student Name: Class: 10th
Paper Type: Half Book Tests Subject: Computer Science
Paper Time: 1:45 hours Maximum Marks: 50
Q1. Choose the correct option. (10X1=10)
1. It is a very common mistake to forget ........ operator in the scanf function.
(A) & (B) % (C) * (D) $
2. What will be the output of code?
void main ()
{
printf ("2");
}
(A) 3 (B) 1 (C) 2 (D) 4
3. Among the following ............ operator has the lowest precedence.
(A) / (B) = (C) (D) !
4. Which symbol is used for logical AND operator?
(A) || (B) && (C) ! (D) #
5. If size of an array is 100, the range of indexes will be:
(A) 0-100 (B) 0-99 (C) 1-100 (D) 2-102
6. Which of the following is correct declaration of array?
(A) (B) (C) (D)
7. .......... structure allows repetition of a set of instructions.
(A) loop (B) conditional (C) control (D) data
8. .............. part of "For loop" is executed first.
(A) condition (B) body (C) initialization (D) increment/decrement
9. How many time "Punjab" will print by using the following statement?
for (a=0;a<=4;a++)
{
printf ("Punjab");
}
(A) 1 (B) 2 (C) 3 (D) 5
10. What is the type of parameter in this function int add (int x, int y)?
(A) int (B) char (C) area (D) float
Q2. Write down short answers of following questions. (4X2=8)
[i] ـDifferentiate between "char" and "int". [ii] ـDescribe the purpose of escape sequence with an example.
[iii] ـSolve this expression: 18/(15-3*2) [iv] ـDefine binary operators
Q3. Write down short answers of following questions. (4X2=8)
[i] ـWhat will be the output of the following code: [ii] ـDeclare an array of float type to store marks of five students.
{ [iii] ـWhat is the output of following code?
int a=7, b=10; int S=0;
a=a+b; for (int a =1;a<5; a++)
b=b-a; {
print f ("%d%d";a,b); S=S+a;
} printf ("Sun=%d",S);
}
[iv] ـHow is loop used to write values in array?
Q4. Write down short answers of following questions. (4X2=8)
[i] ـHow many types of loops are there in C language? Write down [ii] ـWhat is the output of following code?
their names. for (int a=0;a<4;a++)
printf ("Pakistan ");
[iii] ـWhat is the advantage of divide and conquer opproach? [iv] ـFind the errors in the following:
void sum (int a, int b);
{
return a+b;
}
Q5. Write detailed answers of the following questions. (6X4=24)
1. (a) Define operators. Explain any three arithmetic operators in C- language example.
(b) What is escape character? Describe an escape sequence used for new line with example.
2. (a) Write down a program to print odd number form 1-9 using "for" loop.
(b) Write a program using "for" loop to print table of any number.
3. (a) Write a program using "for Loop" to print Counting from 11 to 15.
(b) Write a program in C-Language that takes a number form user and prints table that numbers (using loop) on a screen.