0% found this document useful (0 votes)
19 views2 pages

Guess 1

This document is a guess paper for Computer Science II for students at FG Boys Inter College Karachi Cantt. It includes multiple choice questions, short answer questions, and detailed answer questions, covering various topics in C programming. The paper is structured into three sections with specific instructions for answering each section.

Uploaded by

zeeanbaloch786
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)
19 views2 pages

Guess 1

This document is a guess paper for Computer Science II for students at FG Boys Inter College Karachi Cantt. It includes multiple choice questions, short answer questions, and detailed answer questions, covering various topics in C programming. The paper is structured into three sections with specific instructions for answering each section.

Uploaded by

zeeanbaloch786
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/ 2

FG BOYS INTER COLLEGE KARACHI CANTT

NAME OF STUDENT
Guess Paper 1
___________________
_
Time: 20 minutes COMPUTER SCIENCE–II (KARACHI BOARD) Max Marks: 15

SECTION ‘A’
(MULTIPLE CHOICE QUESTIONS)–(MCQs)
NOTE: i) This section consists of 15 part questions and all are to be answered. Each question carries one mark.
ii) The correct answer bubble must be filled on OMR sheet A B C D pasted in answer script.
iii) Use only blue / black ball point pen or pointer on OMR sheet.
iv) Avoid using pencil / White-o pen on OMR sheet.

1. Select the correct answer for each from the given options:

1) Output of printf(“%d”,x++) is. Note where x=5


(A) 4 (B) 5 (C) 6 (D) error
2) Output of printf(“%d”,sizeof(x)) is. Note where x=10
(A) 10 (B) 4 (C) 3 (D) 8
3) Continue statement in loop results in
(A) exit from loop (B) bypass next statements (C) termination of loop (D) jump to label in loop
4) Any C program must have this function
(A) start() (B) getch() (C) main() (D) printf()
5) Denis Riche is founder of this language
(A) C (B) Basic (C) Java (D) Pascal
6) % operator used with
(A) char (B) float (C) int (D) double
7) This is called address operator
(A) % (B) & (C) && (D) <
8) This operator has highest precedence in arithmetic operators
(A) % (B) / (C) - (D) +
9) Source program are converted in to machine language with help of
(A) Editor (B) Assembler (C) Compiler (D) Debugger
10) This is not a valid variable in C
(A) my (B) m-y (C) m_y (D) m__y
11) This is called indirection operator
(A) % (B) & (C) * (D) <
12) This statement terminates loop
(A) break (B) continue (C) default (D) exit
13) Which of the following is the correct way to declare an array in C?
(A) int arr[]; (B) int arr[5]; (C) int arr[5] = {}; (D) array int arr[5];
14) Which operator is used to access the value at the address a pointer is pointing to?
(A) * (B) ^ (C) & (D) &&
15) How do you declare a string in C?
(A) char str[] = "Hello"; (B) char str[6] = "Hello"; (C) char *str = "Hello"; (D) All of the them
----------------------xxxxxxxxxx----------------------
FG BOYS INTER COLLEGE KARACHI CANTT
NAME OF STUDENT
Guess Paper 1
___________________
_
Time: 2 hours 40 minutes COMPUTER SCIENCE–II (KARACHI BOARD) Max Marks: 60

SECTION ‘B’ (30 Marks)


(SHORT–ANSWER QUESTIONS)
NOTE: Attempt any TEN part question from this section. All questions carry equal marks. (10x3=30)

Q2.
i. Briefly define three type of errors that can occur in computer program.
ii. What are reserved word or keywords in C? Define any four.
iii. Identify valid or invalid variables of the following.
1. number 2. You&me 3. case 4. integer 5. double 6. my-name
iv. Convert following mathematical expression in to equivalent ‘C’ expression
1
1). 𝑥 = 𝑏𝑎𝑠𝑒 ∗ ℎ𝑒𝑖𝑔ℎ𝑡 2.) 𝑥 = 3𝑎𝑏 3 ― 3𝑎 2 𝑏 3). 𝑥 = |𝑏 2 ― 4𝑎𝑐|
2
v. What is difference between arithmetic and arithmetic assignment operator?
vi. What is pointer? Why they are used in C programs?. What is purpose of indirection operator (*)?
vii. What is address operator? Give an example
viii. Differentiate between Actual Parameters and Formal Parameters.
ix. Define two ways in which arguments can be passed to function
x. Differentiate between local/internal and external global variables in C with examples.
xi. Write the following in while () equivalent
void main(void){
int a =3;
do{
printf(“%d\n”,a);
a=a+3;
}while (a==10);
xii. Write a function named max in C that receives two integer and returns maximum of two. Also write a
function named sum in C that receives two integer and returns their sum.
xiii. Write a program in C that show table of inputted number.
xiv. Write a program in C that generates following output. (use any loop)
2 4
3 6
4 8
5 10
xv Write a program in C that takes number input from user and print “number found” if number is found inside
array. int arr[5] = {1,2,3,4,5};
SECTION – C (30 Marks)

(DETAIL ANSWERED QUESTIONS)


NOTE: Attempt any THREE questions from this section. (3x10=30)
Q3. Explain all data types with their sizes in C language.
Q4. How many types of decision structure are there in C? Define with syntax and examples.
Q5. Explain unconditional statements (break, continue, goto, return) with syntax and example in C.
Q6. Define Nested loops. Explain do while loop with syntax and example in C. Also differentiate between do while and
for loop.
Q7. Explain four method of user defined functions.
---------------------xxxxxxxxxx---------------------

You might also like