Download SOLVED PAPERS OF ICS PART-2 (Computer Science) LAHORE

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Open Database Connectivity wikipedia , lookup

Concurrency control wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Database wikipedia , lookup

Functional Database Model wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Database model wikipedia , lookup

Transcript
SOLVED PAPERS OF ICS PART-2
(Computer Science)
LAHORE BOARD 2010
MCQ’S
1. How many primary keys can be a table has?
(a) 1
(b) 2
(c) 5
2. Which of the following is a one-to-many relationship?
(a) Student-Reg. No.
(b) Person-ID-card No.
(c) Mother-Daughter
(d) president-Company
3. In a 2NF, which form of dependency is removed:
(a) Functional
(b) Partial
(c) Associative
4. The columns of a table correspond to:
(a) Table
(b) Record
(c) Field
5. What is the default field size of a text data type field:
(a) 2
(b) 5
(c) 20
6. Which of the following is not a function of report:
(a) Display data
(b) Edit data
(c) Output of database application
(d) Print data
7. Header file in C contains:
(a) Compiler command
(b) Library functions
(c) Header information of C program
(d) Operators for file
8. The expression 10%3 has a value equal to:
(a) 1
(b) 3
(c) 8
9. The statement i+=3 has the same effect as:
(a) i=i+3
(b) i=3
(c) i-3=I
10. Which of the following function is used to input data in C programs:
(a) scanf
(b) printf
(c) sqrt
11. An expression that uses a relational operator is known as:
(a) Operational
(b) Sequential
(c) Serial
12. Another term for a conditional operator is:
(a) Ternary
(b) Binary
(c) Byte
13. A loop within a loop is called:
(a) Nested loop
(b) Simple loop
(c) Conditional loop
14. A variable declaration outside any function is known as:
(a) Global variable
(b) Local variable
(c) External variable
15. While loop is also called:
(a) Wend loop
(b) Simple loop
(c) Conditional loop
(d) No Limit
(d) Transitive
(d) Cell
(d) 50
(d) 0
(d) i3
(d) getch
(d) Relational
(d) Iteration
(d) Counter loop
(d) Static
(d) Counter loop
Short Questions
1. Define database?
A database is a collection of logically related data sets or files. Each file may contain different types of
information and are used for specific purposes.
2. Define secondary key?
An attribute or set of attributes that is basis for retrieval is known as secondary key. Secondary key can be a
non-unique attribute. One secondary key value may refer to many records.
3. Describe the use of control key?
An attribute or set of attributes that is used to physically sequence the stored data is called sort key. It is also
known as control key.
4. Define entity and object?
Anything that is participating in the system is known as data entity. An entity can be a person, place , thing and
event.
5. Explain the logical database design?
The logical model describes the data stored in the database. It contains the definition of the data to be stored in
database. It is the complete description of data stored in database.
6. Describe redundancy?
Data redundancy means the duplication of data in multiple files. The data in database appears only once. It is
not duplicated.
7. Describe partial dependency?
A type of dependency in which one or more non-key attributes are functionally dependent on a part of primary
key is called partial dependency.
8. List major database objects used in MS Access?
The major database objects in MS Access are:
Tables, Queries, Forms and Reports
9. What is DBMS?
A database management system (DBMS) is a collection of programs that are used to create, maintain and access
database in a convenient and efficient manner. DBMS uses database manager software to control the overall
structure of a database.
10. Define linking?
The process of linking in MS Access creates a link to an object in another database. The table is not copied to the
current database.
11. How can you minimize redundant data in a relational database?
We can minimize redundant data in a relational database through normalization.
12. Define assignment operator?
A statement that assigns a value to variable is known as assignment statement. The assignment operator = is
used in assignment statement to assign a value or computational result to a variable.
13. List different types of operators in C?
Logical operators, Relational operators, Arithmetical operators
14. What is comment statement?
Comments are the lines of program that are not executed. The compiler ignores comments and does not include
them in the executable program. Comments can be added in programs in two ways:
 Single-line comments
 Multi-line comments
15. What is a compiler?
A compiler is a program that converts the instructions of a high level language into machine language as a
whole.
16. What are logical errors?
A type of error that occurs due to poor logic of the programmer is known as logical error.
17. Difference between getch() and getche()?
The getch() function is used to input single character from the user that is not displayed on the screen. getche()
function displays the character on the screen entered by the user.
18. Differentiate between printf() and scanf()?
printf() function is used to display output on the monitor. It can display text, constant or values of variables on
screen in specified format.
The scanf() function is used to get input from the user. The input is stored in a variable.
19. What are header files?
Header files are collection of standard library functions to perform different tasks. Each header file contains
different types of predefined functions.
20. Describe if-else statement?
If-else statement is another type of if statement. It executes one block of statement(s) when the condition is
true and other when it is false.
Syntax:
if (condition)
statement;
else
statement;
21. Define operators?
Operators are the symbols that are used to perform certain operations on data. C provides a variety of
operators.
22. Compare while and do-while loop?
While loop is a simplest loop of C language. This loop executes one or more statement while he given condition
remains true.
Do-while loop is an iteration control in C language. This loop executes one or more statement while the given
condition is true. The condition in this loop comes after the body of loop. This loop executes at least one
statement even the condition is false in beginning.
23. How a function returns value?
A function can return a single value. The return type in function declaration indicates the type of value returned
by a function. For example int is used as return type if the function returns integer value.
24. What is controlled counter loop?
Another name of for loop is called control counter loop. For loop executes one or more statements for a
specified number of times.
25. Why we use parameters in functions?
Parameters are the values that are provided to a function when the function is called.
26. Define local variable?
A variable declare inside a function is called a local variable. It is also known as automatic variable.
27. Explain the scope of global variable?
Global variable can be used by all functions in the program.
SOLVED PAPERS OF ICS PART-2
(Computer Science)
LAHORE BOARD 2011
MCQ’S
1. The manipulated and processed data is called:
(a) Object
(b) Information
(c) Data
2. A relation is also known as:
(a) Table
(b) Tuple
(c) Relationship
3. Customers, cars and parts are examples of:
(a) Entities
(b) Attributes
(c) Cardinals
4. A relation that contains minimal redundancy and allows easy use is called:
(a) Clean
(b) Simple
(c) Complex
5. Microsoft access saves the database with extension:
(a).mdb
(b).msdb
(c).madb
6. How many table views are available in Microsoft access:
(a) 4
(b) 3
(c) 1
7. Every C statement ends with a:
(a) Period
(b) Comma
(c) Semicolon
8. A+=b is equivalent to:
(a) b+=a
(b) a=+b
(c) c=a+b
9. Which of the following statement assign a value to many variables:
(a) Compound assignment statement
(b) L-Value
(c) R-Value
(d) Input statement
10. Format specifier is started with symbol:
(a) ?
(b) %
(c) &
11. In if statement false is represented by:
(a) 0
(b) 1
(c) 2
12. Another term for conditional operator is:
(a) Binary
(b) Ternary
(c) Byte
13. The loop which never end is called:
(a) Running loop
(b) Infinite loop
(c) Nested loop
(d) Name
(d) Attribute
(d) Relationships
(d) Well structured
(d).msadb
(d) 2
(d) Colon
(d) b=b+a
(d) @
(d) 3
(d) Iteration
(d) Continues loop
14. One execution of loop is known as:
(a) Cycle
(b) Duration
15. The scope of a variable refers to its:
(a) Length
(b) Same
(c) Iteration
(d) Test
(c) Accessibility
(d) Data type
Short Questions
1. Define data file?
A type of file that contains data is called data file. Data files are created by the software being used. Notepad
and word processor are the examples of data file.
2. Explain DBMS?
A database management system (DBMS) is a collection of programs that are used to create, maintain and access
database in a convenient and efficient manner. DBMS uses database manager software to control the overall
structure of a database.
3. What is meant by access security?
Access security refers to the protection of database from unauthorized access. It may include passwords and
access restrictions.
4. Define the term table?
A table is used to store information about an entity. An entity is anything about which information is stored in
the database.
5. Differentiate between secondary key and primary key?
An attribute or set of attributes that is basis for retrieval is known as secondary key. Secondary key can be a
non-unique attribute. One secondary key value may refer to many records.
An attribute or set of attributes that uniquely identify a row or record in a relation is known as primary key. A
relation can have only one primary key. Each value in primary key attribute must be unique.
6. What is the use of ER-Diagram?
An ER-Diagram is a graphical representation of tables in a database and a relationship between them.
7. Define determinant?
A determinant is an attribute whose value enables us to obtain the value(s) of other related attribute. It appears
on the left side of a functional dependency.
8. Define IDE?
IDE stands for Integrated Development Environment. It is a collection of facilities provided to the users. It used
by database designers and application programmers. It is used to create database design and database
applications.
9. What is meant by degree of relation?
The number of fields or attributes in a relation is called the degree of relation. A relation with five fields has a
degree of 5.
10. Differentiate between source code and object code?
A program written in a high level language is called source code. Source code is also called source program.
Computer cannot understand the statements of high level language.
A program in machine language is called object code. It is also called object program or machine code. Computer
understands object code directly.
11. Define structured programming?
In structured programming languages, the entire logic of the program is implemented in a single module or
function.
12. What is meant by debugging?
The process of finding and removing bugs is called debugging.
13. Find the error in the following code
main();
{
print f(“hello”);
}
Syntax error: There is irregular gap between print and f. Correct keyword is “printf”
14. Define keyword?
Keyword is a word in C language that has a predefined meaning and purpose. The meaning and purpose of a
keyword is defined by the developer of the language. It cannot be changed or defined by the user. Keywords are
also known as reserved words.
15. What are comments?
Comments are the lines of program that are not executed. The compiler ignores comments and does not include
them in the executable program. Comments can be added in programs in two ways:
 Single-line comments
 Multi-line comments
16. Trace the output of the following C program:
main()
{
int a,b;
a=77;
b=40;
a+=b;
printf(“A=%d”,a);
}
A=147
17. Define escape sequence?
Escape sequence are special characters used in format string to modify the format of output. These characters
are not displayed in the output.
18. Define standard output?
The process of getting something from the computer is known as output.
19. Define selection structure?
A statement used to control the flow of execution in a program is called control structure.
20. Write the alternative of if-else statement?
Switch statement is the alternative of if-else statement.
21. What is the output of following code:
int i=1;
while(i<=15)
{
printf(“%d\n”,i);
i=i+1;
}
Output: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15.
Note: Each digit will print in new line.
22. State the use of new line marker?
The ENTER key is used to move the cursor to the next line in a text editor such as notepad.
23. Define infinite loop?
A loop in which the ending condition never occurs is called infinite loop.
24. Define function?
A function is a named block of code that performs some action. The statement written in a function is executed
when it is called by its name.
25. Define user define function?
A type of function written by the programmer is called user defined function.
26. Define format string?
The format string is given in double quotes. It is also called control string.
27. Define a stream?
A logical interface to a file is known as stream. A stream is associated with a file using an open operation.
SOLVED PAPERS OF ICS PART-2
(Computer Science)
LAHORE BOARD 2012
MCQ’S
1. A collection of raw facts and figure is called
(a) File
(b) Data
2. Create command is used to create:
(a) Table
(b) Repot
3. Which is not included in the definition of entity:
(a) Person
(b) Object
4. In 3NF, which form of dependency is removed:
(a) Functional
(b) Non-functional
5. The columns of a table corresponds to:
(a) Table
(b) Record
6. The data in tables is entered in:
(a) Design view
(b) Normal view
7. Computer program is also known as:
(a) Procedure
(b) Software
8. The number of digit after decimal point is called:
(a) Significance
(b) Precision
9. Format specifier is started with symbol:
(a)?
(b) #
10. Another term for conditional operator is:
(a) Iteration
(b) Byte
11. The call label ends with:
(a) End select
(b) End call
12. A file is stored in:
(a) RAM
(b) ROM
13. The scope of variable refers to its:
(a) Length
(b) Name
14. Every C statement ends with a:
(a) ,
(b) ;
15. One execution of instruction is called:
(a) Cycle
(b) Iteration
(c) Processing
(d) Information
(c) Query
(d) Form
(c) Concept
(d) Action
(c) Associative
(d) Transitive
(c) Field
(d) Cell
(c) Data sheet view
(d) Layout view
(c) Hardware
(d) Algorithm
(c) Range
(d) Scope
(c) %
(d) @
(c) Ternary
(d) Binary
(c) Break
(d) Call else
(c) Hard-disk
(d) Cache
(c) Accessibility
(d) Data type
(c) :
(d) }
(c) Scope
(d) Repletion
Short Questions
1. Differentiate between data and information?
Raw facts and figures are called data and processed form of data is called information.
2. Name four major components of database systems?
The components of database system are data, hardware, software and personnel.
3. State the purpose of index file?
An index is used to determine the location. Index is used to speed up the sorting and searching process.
4. Define entity?
Anything that is participating in the system is known as data entity. An entity can be a person, place , thing and
event.
5. List different types of relationships?
Three types of relationships which are one to one relationship, one to many relationship and many to many
relationship.
6. What are database anomalies?
Database anomalies are the problems in relations that occur due to redundancy in the relations. These
anomalies affect the process of inserting, deleting and modifying data in the relations.
7. Why reports are important?
Reports are the outputs of database application. Reports are used to retrieve and present data in a formatted
way. The information on reports is arranged in different ways. A report may also contain graphs, charts and
tables etc.
8. State the use of wild cards?
Wild card is a special symbol that is used in queries to search data. Some important wildcards are * and?
9. Which two database objects can be used to create a report?
Columnar reports and tabular report
10. Why C language is known as strongly typed language?
C is a strongly typed language. It means that a variable must always be declared before it can be used in a
program.
11. What is the concept of header file?
Header files are collection of standard library functions to perform different tasks. Each header file contains
different types of predefined functions.
12. Write the alternative of if-else statement?
Switch statement is the alternative of if-else statement.
13. What is an expression?
A statement that evaluates to a value is called an expression. An expression gives a single value. An expression
consists of operators and operands.
14. Differentiate between syntax error and logical error?
Syntax error is a type of error that occurs when an invalid statement is written in program. Syntax errors are
detected by compiler.
A type of error that occurs due to poor logic of the programmer is known as logical error.
15. Describe assignment statement?
A statement that assigns a value to variable is known as assignment statement. The assignment operator = is
used in assignment statement to assign a value or computational result to a variable.
16. Trace the output of the program:
void main()
{
int n,a,b;
n=400;
a=n%100;
0
b=n/10;
40
n=n%10;
0
printf(“result=%d%d%d”,n,b,a);
gecth();
}
Output: 0 40 0
17. What is the purpose of ampersand (&) operator in scanf() function?
The “&” sign refers to the memory location of the variable in which the input is stored. It is placed before
variable name.
18. Trace the error in the program:
void main()
{
p=3.141593
int x,y;
x=10;
y=30;
z=x+y;
printf(“result=”,z);
getch();
}
Error: semicolon is missed in line No.3.
19. Define the use of if statement?
“if” is a keyword in C language. “if” statement is a decision-making statement. It is the simplest form or selection
constructs. It is used to execute or skip a statement or set of statement by checking a condition.
Syntax:
If (condition)
Statement;
20. Why switch statement is used?
The switch statement is another conditional structure. It is a good alternative of nested if-else statement. It can
be used easily when there are many choices available and only one should be executed.
Syntax:
switch (expression)
{
case 1:
statement;
break;
case 2:
statement;
break;
default:
statement;
}
21. Trace out errors:
{
Int t;
R=25;
If(r=<0)
}
R=3.14*r*r;
};
print f (“value should be positive”);
}
Errors: }; is wrong syntax. Accurate syntax is }.
Print f is a wrong keyword. Correct keyword is printf.
22. When a loop becomes infinite?
When ending condition never occurs; loop becomes infinite.
23. What is difference between while loop and do-while loop?
While loop is a simplest loop of C language. This loop executes one or more statement while he given condition
remains true.
Do-while loop is an iteration control in C language. This loop executes one or more statement while the given
condition is true. The condition in this loop comes after the body of loop. This loop executes at least one
statement even the condition is false in beginning.
24. Define string?
The format string is given in double quotes. It is also called control string.
25. What is function definition?
A function is a named block of code that performs some action. A statements written in a function are executed
when it is called by it is called by its name.
26. Define puts() function?
The puts() function is used to display string on the screen.
27. What is function call?
The statement that activities a function is known as function call.
SOLVED PAPERS OF ICS PART-2
(Computer Science)
LAHORE BOARD 2013
MCQ’S
1. An attribute is also known as:
(a) Table
(b) Relation
(c) Row
2. Two or more attributes having different names but same meaning are called:
(a) Homonyms
(b) Aliases
(c) Synonym
3. What is the default field size of text data type field?
(a) 2
(b) 5
(c) 20
4. Microsoft access saves the database with extension:
(a).mdb
(b).msdb
(c).madb
5. The logical representation of an organization’s data is called a(n):
(a) DBMS
(b) ER Model
(c) DBA
6. Which of the following is an example of a database?
(a) Phone book
(b) Library catalog
(c) Student records
7. An if inside another if is:
(a) A branch
(b) Nested if
(c) A relational
8. Which of the following is a arithmetic operators?
(a) A
(b) (c) %
9. The printf is a __________ function:
(a) Built-in
(b) User define
(c) Local
10. Which of the following are valid case in switch?
(a) Case 1:
(b) case x < 4:
(c) case ‘ab’:
11. Which is a loop statement?
(a) If
(b) if-else
(c) switch
12. A file is stored in:
(a) RAM
(b) ROM
(c) Hard disk
13. Format specifier for char data type is:
(a) %s
(b) %c
(c) %d
14. Which loop structure always executes at least once:
(a) do-while
(b) for
(c) while
15. An IDE typically consists of:
(a) Text editor
(b) Compiler
(c) Debugger
(d) Field
(d) None
(d) 50
(d).msadb
(d) None
(d) All
(d) A conditional operator
(d) >
(d) All of these
(d) case 1.5:
(d) None of these
(d) Cache
(d) %f
(d) None of these
(d) All of these
Short Questions
1. Define database?
A database is a collection of logically related data sets or files. Each file may contain different types of
information and are used for specific purposes.
2. Describe program file?
A type of file that contains the software instruction is called program file. The source program files and
executable files are examples of program files. The source program file may have an extension of .com and .exe.
3. What is the purpose of index key?
An index is used to determine the location. Index is used to speed up the sorting and searching process.
4. What is entity?
Anything that is participating in the system is known as data entity. An entity can be a person, place , thing and
event.
5. Define attribute?
The characteristics of an entity are called attributes. An entity may have many attributes. Some examples of an
attributes of teacher are name, gender telephone no.etc.
6. Describe action query?
An action query is used to make changes in specified records on an existing table. It is also used to create a new
table.
7. How is referential integrity achieved?
The referential integrity is a constraint on foreign key value. It states that if a foreign key exists in a relation, the
foreign key value must match the primary key value of some tuple in its parent relation.
8. Define the term DBMS?
A database management system (DBMS) is a collection of programs that are used to create, maintain and access
database in a convenient and efficient manner. DBMS uses database manager software to control the overall
structure of a database.
9. What is columnar form?
Columnar form is used to display one record at a time. it displays textboxes and labels.
10. Describe the term machine independence?
It means that program written in high level language can be executed in different computer. C program provide
machine independence.
11. Describe structure programming language?
In structured programming languages, the entire logic of the program is implemented in a single module or
function.
12. What is an assembler?
An assembler is a translating program that translates the instruction of assembly language into machine
language.
13. Why is C known as strongly typed language?
C is a strongly typed language. It means that a variable must always be declared before it can be used in a
program.
14. What do you know about the term keyword?
Keyword is a word in C language that has a predefined meaning and purpose. The meaning and purpose of a
keyword is defined by the developer of the language. It cannot be changed or defined by the user. Keywords are
also known as reserved words.
15. What is a variable declaration?
The process of specifying the variable name and its type is called variable declaration. A program can have as
many variables as needed. The variable declaration provides the information to the compiler about the variable.
16. What is the output of the following program?
main()
int a=21;
printf(“%d”,a%2);
}
Output: 1
17. Trace errors if any:
main()
{
int h,w,a;
h=5; w=4;
a=h*w;
printf(“area=”,a);
}
There is no error in program.
18. What is range?
Range is the exponential power of 10.
19. Define control structure?
A statement used to control the flow of execution in a program is called control structure. The control structures
in C are used to combine individual instructions into a single logical unit.
20. State the use of actual parameters?
Actual parameter is used in the function call. There are the actual values pass to function definition in function
call.
21. Write the syntax of goto() statement?
goto label;
.
.
label: statement
22. Define local variable?
A variable declare inside a function is called a local variable. It is also known as automatic variable.
23. What do you mean by string?
The format string is given in double quotes. It is also called control string.
24. How many times will the following loop display “ok”.
for (int i=0; i<20; i++)
printf(“ok”);
“ok” will display in 20 times.
25. Rewrite as do-while loop
int i=1;
while(i<=15)
{
printf(“ok”);
i=i+1;
}
Rewrite as do-while loop:
int i=1;
do{
printf(“ok”);
i=i+1;
} while(i<=15);
26. What is infinite loop?
A loop in which the ending condition never occurs is called infinite loop.
27. Explain do-while loop?
Do-while loop is an iteration control in C language. This loop executes one or more statement while the given
condition is true. The condition in this loop comes after the body of loop. This loop executes at least one
statement even the condition is false in beginning.
SOLVED PAPERS OF ICS PART-2
(Computer Science)
LAHORE BOARD 2014
MCQ’S
1. How many are the layout of report?
(a) 2
(b) 3
(c) 4
(d) 5
2. SQL stands for:
(a) Structured query language
(b) Sort query language
(c) Self query language
(d) Seek query language
3. Which of the following is not included in the definition of entity:
(a) Person
(b) Object
(c) Concept
(d) Action
4. How many table views are available in MS Access?
(a) 4
(b) 3
(c) 2
(d) 1
5. The columns of a tale correspond to:
(a) Table
(b) Record
(c) Field
(d) Cell
6. The goal of normalization is to:
(a) Get stable data structure
(b) Increase number of relation
(c) Increase redundancy
(d) None of these
7. A two dimensional table of data is called a:
(a) Group
(b) Set
(c) Declaration
8. Which statement is used to move the control to the start of loop body:
(a) continue
(b) break
(c) switch
9. On successful closing a file, the fclose() returns:
(a) Null
(b) Zero
(c) One
10. Which of the following loop is called counter loop:
(a) for
(b) while
(c) do-while
11. Which is an example of multiple branches from single expression:
(a) if statement
(b) switch statement (c) while loop
12. Local variables are also called:
(a) Automatic
(b) Normal
(c) Global
13. The format specifier %u is used for:
(a) Integer
(b) Unsigned short
(c) Signed float
14. Which escape sequence can be used to begin a new line in C:
(a) \a
(b) \b
(c) \n
15. Which of the following is equivalent to (p>=q)
(a) P<q
(b)!(p<=q)
(c) p>q
16. Variables are created in:
(a) RAM
(b) ROM
(c) Harddisk
17. Which of the following key is used to save a file
(a) F2
(b) F3
(c) F5
(d) Relation
(d) None
(d) File pointer
(d) if
(d) for loop
(d) None of these
(d) Unsigned long int
(d) \m
(d) !(p>q)
(d) Cache
(d) F9
Short Questions
1. What is data?
Raw facts and figures is called data.
2. What is field?
A combination of one or more characters is called field. It is the smallest unit of data that can be accessed by the
user. The name of each field in a record is unique.
3. Define sub-form?
A sub form is a form that is placed in a parent form. The parent form is also called main form. Sub form is also
known as child form.
4. What are the properties of relation?
 No duplicate rows exist
 The order of rows and columns are insignificant
 Columns/Attributes are all elemental or atomic
5. What is a view?
A view is also known as Virtual Table. It is created by using SQL. SQL stands for Structured Query Language. It is a
powerful database language. It is used for data definition and data manipulation.
6. What is the purpose of index file?
An index is used to determine the location. Index is used to speed up the sorting and searching process.
7. What is data modeling?
A representation of real world objects, events and their association is called a data modeling.
8. How entity integrity is maintained?
The entity integrity is a constraint on primary key value. It states that any attribute of a primary key cannot
contain null value. If primary contain null value, it is not possible to uniquely identify a record in a relation.
Entity Integrity is maintained by DBMS.
9. What is the use of MS-Access?
Microsoft Access is used to store and produce a large amount of information. It is used to create queries, forms
and reports easily. It allows entering, updating and reporting information.
10. What is query?
A query is a statement that extracts specific information from database. A query is created by specifying fields to
display from a table or another query.
11. What is string?
A collection of characters in double quotes is called string.
12. Define list box?
List box is used to display a list of item in forms. The user can select the desired items from the available items.
The user can select one or multiple items.
13. What is assembler?
An assembler is a translating program that translates the instruction of assembly language into machine
language.
14. What do you know about C statement?
A statement in C language is an instruction for the computer to perform a task. The statements are written in
curly braces. Each statement is terminated with semicolon.
15. Define expression?
A statement that evaluates to a value is called an expression. An expression gives a single value. An expression
consists of operators and operands.
16. Find the error in the code:
#include <stdio.h>
void main();
{
X=20
Y=40
Z=x+y
printf(“%d”,z)
gectch();
}
Errors: syntax error in Line No: 2- Semicolon is used after void main()
syntax error in Line No: 4,5,6,7- Terminators are misplaced.
17. What is increment operator?
The increment operator is used to increase the value of a variable by 1. It is denoted by the symbol ++.
It is a unary operator and works with single variable. Increment operator can be used in two forms:
 Prefix form
 Postfix form
18. What is the use of scanf() function?
The scanf() function is used to get input from the user. The input is stored in a variable.
19. What is format specifier?
Format specifier is used to specify the format according to which value will be read and displayed.
20. Explain clrscr() function?
The clrscr( ) used to clear the screen. It is an abbreviation of clear screen. When this function is executed the
screen is cleared and the cursor blinks on top left corner.
21. Trace the output:
void main()
{
char w1=’a’, w2=’b’, w3=’c’;
printf(“%c %c %c”,w1, w2, w3);
getch();
}
Output: abc
22. List some important functions of output?
Output function is display output on monitor.
23. What do mean by selection?
Selection means execute statement(s) on the basis of condition.
24. Describe user defined function?
A type of function written by the programmer is called user defined function.
25. Trace the output:
void main()
{
int a, b, temp;
a=10;
b=20;
temp=b;
b=a;
a=temp;
printf(“%d\n”,a);
printf(“%d\n”,b);
getch();
}
Output:
20
10
26. Write the syntax of conditional operator?
Conditional operator is a decision-making structure. It can be used in place of simple if-else structure. It is also
called ternary operator as it uses three operands.
Syntax:
(condition)? True-case statement: false-case statement;
27. What is goto() statement?
The goto statement is used to perform an unconditional transfer of control to a named label. The label must be
in the same function.
28. List some benefits of function?
 Easier to code
 Easier to modify
 Easier to maintain and debug
 Reusability
 Less programming time
29. Define pointer?
A type of variable that is used to store the memory address of a memory cell is known as a pointer.
30. What are header files?
Header files are collection of standard library functions to perform different tasks. Each header file contains
different types of predefined functions.
31. Describe if statement?
“if” is a keyword in C language. “if” statement is a decision-making statement. It is the simplest form or selection
constructs. It is used to execute or skip a statement or set of statement by checking a condition.
Syntax:
if (condition)
Statement;
32. Write are arithmetical operator?
Operators are the symbols that are used to perform certain operations on data. C provides a variety of
operators. Some arithmetic operators are + , - , /, % , * .
SOLVED PAPERS OF ICS PART-2
(Computer Science)
DATABASE
2010, 2011, 2012, 2013, 2014
OTHER THAN LAHORE BOARD
1. Define data?
Data is a collection of facts, figures and statistics related to an object. An object can be a person, event or
anything about which data is gathered. Data can be processed to create useful information.
2. Define information?
The processed data is called information. Information is meaningful, useful and organized. It is used for making
decisions. Data is used as input for processing and information is the output of this processing.
3. What is data processing?
The process of manipulating data to achieve the required objectives and results is called data processing. The
software is used to process data. The software converts data into meaningful information.
4. List different activities in data processing?
Different activities involved in data processing are data capturing, data manipulation and managing output
results.
5. Define data capturing?
The process of recording the data in some form is called data capturing. Data is captured before it can be
processed. Data may be recorded on source documents.
6. Define data manipulation?
The process of applying different operations on data is called data manipulation.
7. Define field?
A combination of one or more characters is called field. It is the smallest unit of data that can be accessed by the
user. The name of each field in a record is unique.
8. Define record?
A collection of related fields treated as a single unit is called a record. For example, an employee’s record
includes a set of fields that contains Employee Number, Employee Name, Grade and designation etc.
9. Define file?
A collection of related records treated as a single unit is called a file. File is also known as “data set”. Files are
stored in disk like hard disk, CD-ROM or DVD-ROM etc.
10. Define master file?
Master files are used to store the information that remains constant for a long period of time. The master files
are the files which are latest updates files. These files are never empty since they are created.
11. Define transaction file?
A type of file that is used to store input data before processing is called transaction file. It may be temporary file
and may exist until the master file is updates. It may also be used to maintain a permanent record of the data
about a transaction.
12. Define backup file?
A type of file that is used to take back-up of important data is called backup file. It is a permanent file. It is used
to store an additional copy of data. Backup files are mostly created by using specific software utilities.
13. Define program file?
A type of file that contains the software instruction is called program file. The source program files and
executable files are examples of program files. The source program file may have an extension of .com and .exe.
14. Define data file?
A type of file that contains data is called data file. Data files are created by the software being used. Notepad
and word processor are the examples of data file.
15. Define sequential file?
The records in sequential file organization are stored in sequence. A sequence means the records are stored one
after the other. The records can be retrieved only in the sequence in which they were stored.
16. Define direct or random files?
The records in direct file organization are not stored in a particular sequence. A key value of a record is used to
determine the location to store the record. Each record is accessed directly without going through the preceding
records.
17. Define indexed sequential files?
In indexed sequential file organization, Records are store in ascending or descending order the order is based on
a value called key. Additionally, indexed file organization maintains an index in a file.
18. Define file processing system?
Traditional file processing is the first computer based method to handle business application in the past. Many
organizations stored data in files on tapes or disk.
19. Define data redundancy?
Data redundancy means the duplication of data in multiple files. The data in database appears only once. It is
not duplicated.
20. Define data inconsistency?
File system approach can also result in data inconsistency. Inconsistency means that two files may contain
different data of the same student.
21. Define data dependency?
Program data dependency is a relationship between data in files and program required to update and maintain
the files. Application program are developed according to a particular file format in file processing system.
22. Define database?
A database is a collection of logically related data sets or files. Each file may contain different types of
information and are used for specific purposes.
23. What are the facilities of database system?
The facilities of database system are adding, inserting, retrieving, updating, deleting and removing.
24. Define database system?
A database system is a collection of data as well as programs required to manage that data. A database system is
a computerized record-keeping system.
25. What are the components of database system?
The components of database system are data, hardware, software and personnel.
26. What are the objectives of databases?
The objectives of database system are data integration, data integrity and data independence.
27. Define database model?
A set of rules and standards that define how the database organizes data is called database model.
28. Define database management system?
A database management system (DBMS) is a collection of programs that are used to create, maintain and access
database in a convenient and efficient manner. DBMS uses database manager software to control the overall
structure of a database.
29. What are the objectives of database management system?
The objectives of DBMS are share ability, availability, evolvability and database integrity.
30. Define data dictionary?
Data dictionary is a file that is used to store data definitions or description of the structure of data used in
database. Data dictionary is also called “repository”
31. Define query language?
A query language is used to perform different operations on the databases. The most popular query language is
SQL. It stands for “Structured Query Language”
32. Define backup and recovery?
DBMS provides the facility for backup and recovery. Backup facility is used to store an additional copy of data.
The data can be recovered from backup file if original file is lost or damaged.
33. What are the features of DBMS?
The features of DBMS are data dictionary, utilities, query language, report generator, access security and backup
and recovery.
34. What are the advantages of DBMS?
 Data independence
 Redundancy control
 Consistency constraints
 Support complex data relationships
 Data security features
 Database backup and recovery
 Advance capabilities.
35. What are the disadvantages of DBMS?
The disadvantages of DBMS are high cost, higher hardware cost, additional training, problems in case of wrong
DB environment and need of data dictionary.
36. Define fixed length field?
A fixed length field contains predefined number of characters (bytes). The data entered in fixed length field can
not exceed allocated length of the fields.
37. Define variable length field?
A variable length field does not contain predefined number of characters (bytes). It occupies space according to
the data entered by the user. The variable length field does not contain any extra blank spaces.
38. Define table?
A table is used to store information about an entity. An entity is anything about which information is stored in
the database.
39. Write down the properties of relations?
No duplicate rows exist
The order of rows and columns are insignificant
Columns/Attributes are all elemental or atomic
40. Define view?
A view is also known as Virtual Table. It is created by using SQL. SQL stands for Structured Query Language. It is a
powerful database language. It is used for data definition and data manipulation.
41. Define key?
A key is an attribute or set of attributes that uniquely identifies a tuple in a relation.
42. Define primary key?
An attribute or set of attributes that uniquely identify a row or record in a relation is known as primary key. A
relation can have only one primary key. Each value in primary key attribute must be unique.
43. Define composite key?
A primary key that consists of two or more attributes is known as composite key. For example, the following
relation uses two fields Roll No and subject to identify each tuple.
44. Define candidate key?
A relation may contain many attribute or set of attributes that can be used as primary key. The attribute or set
of attributes that can be used as primary key is called candidate key.
45. Define alternate key?
The candidate keys that are not selected as primary key are known as alternate keys.
46. Define foreign key?
A foreign key is an attribute or set of attributes in a relation whose values match a primary key in another
relation. The relation in which foreign key is created is known as dependent table. The relation to which the
foreign key refers is known as parent table.
47. Define secondary key?
An attribute or set of attributes that is basis for retrieval is known as secondary key. Secondary key can be a
non-unique attribute. One secondary key value may refer to many records.
48. Define sort key?
An attribute or set of attributes that is used to physically sequence the stored data is called sort key. It is also
known as control key.
49. Define end user?
A user or end users are the persons who directly interact with database system. They use database application
without technical knowledge of database. End users interact with the database through an interface.
50. Define data administrator?
A data administrator is a person who is responsible for entire data of an organization. He normally develops
overall functional requirements for database used in the organization. He controls and manages the whole
database system.
51. Define database administrator?
A database administrator is an important person in development of any database system. He is responsible for
the design, implementation, operation, management and maintenance of database.
52. What are the responsibilities performed by DBA?
The responsibilities of database administrator are
53. Define analysis?
A process of studying the existing system is known as analysis. The basic purpose of analysis is to know which
activities are performed in the current system.
54. Define feasibility study?
Feasibility study is also called preliminary investigation. It is conducted to investigate the required database
system. It determines whether the purposed system is affordable, possible and acceptable.
55. Define project planning?
A comprehensive planning and schedule must be developed to complete the project. All cost factors are also
taken into consideration. Different cost factors of a project include the hardware cost and salaries of team
members etc.
56. Define data analysis?
Data analysis is an important aspect of analysis while designing a database.
57. Define data modeling?
A representation of real world objects, events and their association is called a data modeling.
58. What are the ingredients of data modeling?
The ingredients of data modeling are entity, attribute and relationship.
59. Define entity?
Anything that is participating in the system is known as data entity. An entity can be a person, place , thing and
event.
60. Define attribute?
The characteristics of an entity are called attributes. An entity may have many attributes. Some examples of an
attributes of teacher are name, gender telephone no.etc.
61. Define relationship?
A logical connection between different entities is called relationship. The relationship indicates how the entities
are connected or related to each other.
Example: a relationship exists between a student and teacher because their teacher teach student.
62. Define cardinality?
The number of entity occurrences associated with each occurrences of the related entity is known as cardinality.
It specifies how many instance of an entity related to each instance of another entity.
63. Define modality?
Modality describes the relationship as either mandatory or optional. it specifies the minimum number of
relationships.
64. What are the types of relationships?
Three types of relationships which are one to one relationship, one to many relationship and many to many
relationship.
65. Define database design?
The major objective of database design is to map the conceptual data model to implementation model. A
particular DBMS must be able to process this model.
66. Define logical database design?
The logical model describes the data stored in the database. It contains the definition of the data to be stored in
database. It is the complete description of data stored in database.
67. Define physical database design?
Physical database design is the last stage of database design process. The major objective of physical database
design is to implement the database as a set of records, files, indexes and other data structures.
68. What are the major inputs of database design?
The major inputs of database design are logical database structure, user processing requirements and
characteristics of DBMS.
69. Define file organization?
File organization is a technique for physically arranging the records of a file on secondary devices.
70. Define indexes?
An index is a table that is used to determine the location of rows in a table. Indexes are used to speed up the
sorting and searching process.
71. Define integrity constraints?
Database integrity means the correctness and consistency of data. Integrity is maintained with the help of
integrity constraints. These constraints are the rules that are designed to keep data consistent and correct.
72. What are the basic data distribution strategies?
The basic data distribution strategies are centralized, partitioned, replicated and hybrid.
73. Define implementation?
The database is implemented after it has been designed and developed. The database system installed and
executed for the user. Implementation may require a particular type of computer such as server.
74. What is an ER Diagram?
An ER diagram is a graphical representation of tables (entities) in a database and the relationships between
them. It was developed by Peter Chen in 1976.
75. Explain the difference between an entity class and entity instance?
A group of entities of the same type is called entity class. All entities in an entity type share common
characteristics. For example, STUDENT entity class is a collection of all students. A member of an entity class is
also known as entity instance. For example, a student Abdullah of student entity type is an entity instance.
76. Define data integrity?
Database integrity means the correctness and consistency of data. It is another form of database protection.
Integrity is maintained with the help of integrity constraints.
77. Define entity integrity?
The entity integrity is a constraint on primary key value. It states that any attribute of a primary key can not
contain null value. If primary contain null value, it is not possible to uniquely identify a record in a relation.
78. Define referential integrity?
The referential integrity is a constraint on foreign key value. It states that if a foreign key exists in a relation, the
foreign key value must match the primary key value of some tuple in its parent relation.
79. Define synonym?
A synonym is a type of problem that exists in relation. A synonym is created when two different names are used
for the same information or attribute. The name of attribute must be same if it exists in two or more relations.
80. Define homonym?
A homonym is a type of problem that exists in relations. A homonym is created when same name is used for two
different attributes.
81. Define redundancy?
Redundancy means duplication of data in multiple files. It is a type of problem that exists in relations. It is
created when the same information is unnecessarily stored in two different ways or forms.
82. Define mutual exclusiveness of data?
The data that does not have overlapping information is known as mutually exclusiveness data. The mutual
exclusiveness of data creates problem in some cases. It creates problem for the attributes whose values can be
specified as ‘Yes/No” form.
83. Define normalization?
The process of producing a simpler and more reliable database structure is called normalization. It is used to
create a suitable set of relations for storing data.
84. Define functional dependency?
A functional dependency is a relationship between two attributes. It means that if the values of one attribute is
known, it is possible to obtain the value of another attribute.
85. Define 1NF?
A relation is in first normal form (1NF) if every intersection of row and column contains atomic values only. It
means that the relation does not contain any repeating groups. A repeating group is a set of one or more data
items that may occur a variable number of times in a tuple.
86. What are the database anomalies?
Database anomalies are the problems in relations that occur due to redundancy in the relations. These
anomalies affect the process of inserting, deleting and modifying data in the relations.
87. Define partial dependency?
A type of dependency in which one or more non-key attributes are functionally dependent on a part of primary
key is called partial dependency.
88. Define 2NF?
A relation is in second normal form (2NF) if it is in 1NF and every non-key attribute is fully functionally
dependent on the primary key. All non-key attributes must develop on all parts of the primary key.
89. Define transitive dependency?
The transitive dependency is a type of functional dependency between two or more non-key attributes.
Transitive dependency exists if a non-key attribute depends on any other non-key attribute.
90. Define 3NF?
A relation is in third normal form (3NF) if it is in 2NF and no transitive dependency exists. The transitive
dependency is an important factor in normalization.
91. Define MS Access?
Microsoft access is one of the most popular and powerful database management systems. It provides
built-in features to the user. These features help the user to create database and view information.
various
92. What is the use of MS Access?
Microsoft Access is used to store and produce a large amount of information. It is used to create queries, forms
and reports easily. It allows entering, updating and reporting information.
93. Define IDE?
IDE stands for Integrated Development Environment. It is a collection of facilities provided to the users. It used
by database designers and application programmers. It is used to create database design and database
applications.
94. What are the advantages of IDE?
 It is easy to use.
 It simplifies the creation of database applications.
 It does not require a detailed knowledge of database.
It provides predefined facilities to search, sort, retrieve and process data in database.
95. What are the advantages of using MS Access?
The advantages of using MS Access are
 Sample database
 Wizards
 Keys to understand the structure
 Microsoft office integration
 Easier programming
 Command standard
 No redundancy
96. Define RDBMS?
RDBMS stands for relational database management system. It is a collection of programs which are used to
create and maintain relational database. A database in which data is stored in relations is called relational
database.
97. List some facilities provided by a good RDBMS?
 Data security
 Data integrity
 Easy access
 Backup and recovery etc
98. What is database wizard?
A database wizard is a set of steps that guides the user to create a database easily.
99. How is MS Access started?
The following procedure can be used to start MS Access:
Click Start button on Taskbar and select Programs menu item. The Programs submenu will be displayed.
Click Microsoft Access program item. MS Access will be started.
100.
Name different parts application window of MS Access?
The different parts of application window of MS Access are:
 Title Bar
 Menu Bar
 Tool Bars
 Menus
 Scroll Bars
 Status Bar
101.
Define database windows?
The database window in MS Access is used to organize all objects in the database. It contains its own title bar
and toolbar. Database window is divided into two parts.
102.
Name different buttons in database window?
Different buttons in the database window are:
 Tables
 Queries
 Forms
 Reports
 Pages
 Macros
 Modules
103.
Define database object?
A component of a database system is known as database object. MS Access provides various objects that are
used to store and retrieve data from database.
104.
Name the major database objects in MS Access?
The major database objects in MS Access are:
 Tables
 Queries
 Forms
 Reports
105.
Define form?
A graphical interface used to interact with the database is called form.
Forms are used to enter data in database.. the user can also retrieve, change, delete and update data by using
forms.
106.
What are reports?
Reports are the outputs of database application. Reports are used to retrieve and present data in a formatted
way. The information on reports is arranged in different ways. A report may also contain graphs, charts and
tables etc.
107.




List some advantages of reports?
Reports provide quick result from databases.
Reports help in making important decisions.
Reports can display processed data using graphs and charts etc.
Reports can be printed or emailed easily.
108.
Define field or attribute?
A field is a combination of related characters .a field is known as attribute in relational database. An attribute is
a named column of a relation.
109.
Define record or row?
A record is a collection of relation field. A record is known as tuple in relational database. Record is also called
row.
110.
What are the characteristics of table?
 Each field of the table contains only one value.
 Each column has a distinct name. it is the name of the attribute or field it represents.
 The order of the rows and columns is immaterial.
 Each row represents the record.
 Each row is distinct. There are not duplicate rows.
111.
Define degree of a relation?
The number of fields or attributes in a relation is called the degree of relation. A relation with five fields has a
degree of 5.
112.
Define cardinality of a relation?
The number of records or tuples in a relation is called cardinality of a relation. A relation with fifty records has a
cardinality of 50.
113.
Define design view?
The table view that is used to design the structure of a table is called design view. It is used to specify name,
data types and description of fields.
114.
Define datasheet view?
The table view that is used to enter, delete or modify data in a table is called datasheet view. The table in this
view is displayed in rows and columns.
115.
What are the different data types available in MS Access?
MS Access provides the following data types:
 Text
 Memo
 Number
 Date/ time
 Currency
 Auto Number
 Yes/No
 OLE Object
 Hyper Link
116.
Name different methods of modifying a table?
The methods of modifying a table are:
Adding record
Editing records
Deleting records
Inserting and deleting fields
Resizing rows and columns
117.
Define filter?
A filter is used to extract the records that match a set of criteria. Filters are used with opened tables.
118.
Define joining?
Query can be executed against multiple tables. If the tables are related with one another, the query can join
these tables for extracting data.
119.
Define query?
A query is a statement that extracts specific information from database. A query is created by specifying fields to
display from a table or another query.
120.
Name different types of queries?
Different types of queries are:
 Select queries
 Action queries
 Cross table queries
 Parametric queries
 SQL Queries
121.
List different types of action queries?
Different types of action queries are:
 Delete query
 Update query
 Append query
 Make table query
122.
Describe select query?
A select query is used to extract data from tables based on specific values. It gathers information and presents it
in usable form. it may retrieve data from one or more tables.
123.
Describe action query?
An action query is used to make changes in specified records on an existing table. It is also used to create a new
table.
124.
Define cross table query?
The cross table query is used to calculate and restructure data for easier analysis. It calculates a sum, average,
counts or other types of computation for data.
125.
Define parametric query?
A parametric query displays a dialogue box when it is executed. It gets some information from the user as
parameter.
126.
What is field property?
Field properties are used to define how data will be entered, stored and displayed in a MS Access.
127.
What is the use of input mask?
An input mask controls the value of a record and sets it in a specific format. It is similar to format
property but it displayed the format on datasheet before the data is entered.
128.
Define sorting?
The process of arranging data or records in a sequence is known as sorting.
129.
What is the use of wild card?
Wild card is a special symbol that is used in queries to search data. Some important wildcards are * and?
130.
What is auto number data type?
Auto number data type is used to generate the next number automatically when a new record is added.
It creates a unique number for each record.
131.
What are the uses of form?
Form is used to manipulate database easily. It can be used to:
 Add data in the database
 Modify data in the database
 Delete data from the database
 Retrieve and view data from the database
 Search the required data from the database
132.
What are the advantages of form?
The advantages of form are:
 Easier to use
 User-friendly
 No technical knowledge required
 Time saving
 Flexibility
133.
Name different types of form?
MS Access provides the following types of forms:
 Columnar form
 Tabular form
 Datasheet form
 Justified form
134.
Define list box?
List box is used to display a list of item in forms. The user can select the desired item from the available items.
The user can select one or multiple items.
135.
Define combo box?
Combo box is used to display a list of item in forms. It occupies less space than list box. It consists of a textbox
and a dropdown list.
136.
Define check box?
Check box is used to display yes/no, true/false or on/off option to the user. It is used when the user can select
one or multiple options at the same time. A tick sign appears on the check box when the user selects it.
137.
Define radio button?
Radio button is also known as option button. It is used to display yes/no, true/false or on/off option to the user.
It is used when the user can select only one option from a group of radio buttons. A dot sign • appears in the
radio button when the user selects it.
138.
Define sub-form?
A sub form is a form that is placed in a parent form. The parent form is also called main form. Sub form is also
known as child form.
139.
What are the uses of reports?
The reports are basically used for the following purposes:
 Reports present the required information in formatted style.
 Reports provide flexibility to present the same data in different ways.
 Reports can display information with graphics and charts etc.
 Reports are very important in making important decisions.
 Reports can be used to improve the database application
 Reports can display the result of a query.
140.
Define linking?
The process of linking in MS Access creates a link to an object in another database. The table is not copied to the
current database.
141.
Define switchboard?
A switchboard is a form that is used to navigate database and different perform tasks in database application.
SOLVED PAPERS OF ICS PART-2
(Computer Science)
C++
2010, 2011, 2012, 2013, 2014
OTHER THAN LAHORE BOARD
1. Define program?
A computer is a device that follows the instruction given to it. A well-defined set of instructions given to the
computer is called a computer program.
2. Define programming language?
A set of words and symbols used to write programs is called programming language.
3. Name different types of programming language?
Low level language
Machine language
4. Define low level language?
Low level languages are near to computer hardware and far from human languages.
5. Define machine language?
A type of language in which instructions are written in binary form is called machine language. It is the only
language that is directly understood by the computer. it is the native language of the computer.
6. Define assembly language?
Assembly language is a low level language. It is one step higher than machine language. in assembly , machine
instructions are replaced with English like words known as mnemonics.
7. Define high level language?
A type of language that is close to human language is called high level language.
8. Name commonly used high level language?
 C/C++
 Java
 Pascal
 FORTRAN
 BASIC
 COBOL
9. Define source code?
A program written in a high level language is called source code. Source code is also called source program.
Computer cannot understand the statements of high level language.
10. Define object code?
A program in machine language is called object code. It is also called object program or machine code. Computer
understands object code directly.
11. Define language processor?
Language processor is a type of system software that converts these programs into machine language. Every
computer has its own translators.
12. Define compiler?
A compiler is a program that converts the instructions of a high level language into machine language as a
whole.
13. Define interpreter?
An interpreter is a program that converts one statement of a program into machine at one time. It executes a
statement before translating the next statement of a program.
14. Define assembler?
An assembler is a translating program that translates the instruction of assembly language into machine
language.
15. Define identifier?
The identifiers are the names used to represent variable, constants, types, functions and labels in the program.
Identifier is an important feature of all computer languages.
16. What are the rules of identifier?
Some important rules for identifier name are as follows:
The first character must be an alphabet or underscore
The identifier name must consist of only alphabetic characters, digits or underscores.
The reserved word cannot be used as identifier name.
17. What are the types of identifier?
There are two types of identifier in C language:
Standard identifiers
User-defined identifiers
18. Define standard identifier?
A type of identifier that has special meanings in C is known as standard identifier. C cannot use a standard
identifier for its original purpose if it is redefined. printf and scanf are the examples of standard identifiers.
19. Define user-defined identifiers?
A type of identifier that is defined by the programmer to access memory location is known as user-defined
identifier. The user-defined identifiers are used to store data and program results. A. marks and age etc are the
examples of user-defined identifiers.
20. Define keywords?
Keyword is a word in C language that has a predefined meaning and purpose. The meaning and purpose of a
keyword is defined by the developer of the language. It cannot be changed or defined by the user. Keywords are
also known as reserved words.
Examples:
auto
scanf
printf
break
21. Define variable?
A variable is a named memory location or memory cell. It is used to store program’s input data and its
computational results during execution. The value of a variable may change during the execution of program.
The variable is created in RAM.
22. Define variable declaration?
The process of specifying the variable name and its type is called variable declaration. A program can have as
many variables as needed. The variable declaration provides the information to the compiler about the variable.
23. Define variable initialization?
The process of assigning a value to a variable at the time of declaration is known s variable initialization. The
equal sign = is used to initialize a variable. Variable name is written on left side and the value is written on right
side of equal sign.
24. Write down the rules for naming variables in C language?
Following are some rules for naming variables in C language:
 Variable may include letters, numbers and underscore (-)
 The first character of variable must be a letter or underscore
 Blank spaces are not allowed in variable names
 Both upper and lower cases are allowed
25. Define constant?
A constant is a quantity that cannot be changed during program execution.
26. Name different types of constant?
C language provides following types of constants:
Numeric constants
Character constants
String constants
27. Define numeric constants?
Numeric constants consist of numbers. It can be further divided into two parts:
Integer constant
Floating constant
28. Define character constant?
Any character written with in single quotation mark is known as character constant. All alphabetic characters,
digits and special symbols can be used as character constants.
Example:
‘A’
‘n’
‘9’
‘=’ ‘$’
29. Define string constant?
A collection of characters written in double quotation mark is called string or string constant. It may consist of
any alphabetic characters, digits and special symbols.
Example:
“Pakistan”
“123”
“99-Mall Road, Lahore”
30. Define data type?
The data type defines a set of values and a set of operations on those values. The computer manipulates various
types of data. The data is given to the program as input.
31. Name different types of data types?
C language provides two ways two ways to use data types:
Standard data type
User-defined data type
32. Define arithmetic underflow?
The arithmetic underflow occurs when arithmetic calculation is performed on two very small numbers. The
result may be too small to be represented in a particular variable.
33. Define arithmetic overflow?
The arithmetic overflow occurs when calculation is performed on two very large numbers. The result may be too
large to be represented in a particular variable.
34. Define operators?
Operators are the symbols that are used to perform certain operations on data. C provides a variety of
operators. Different operators in C are as follows:






Arithmetic operators
Relational operators
Logical operators
Assignment operators
Increment and decrement operators
Compound assignment operators
35. Define arithmetic operator?
Arithmetic operator is a symbol that performs mathematical operations on data. C language provides many
arithmetic operators. Some arithmetic operators are +, -, *, /, % etc.
36. Define expression?
A statement that evaluates to a value is called an expression. An expression gives a single value. An expression
consists of operators and operands.
37. Define operator and operand?
An operator is a symbol that performs some operations. Operand is the value on which the operator performs
some operations. Operand can be a constant or variable etc.
38. Define assignment operator?
A statement that assigns a value to variable is known as assignment statement. The assignment operator = is
used in assignment statement to assign a value or computational result to a variable.
39. Define unary operator?
A type of operator that works with one operand is known as unary operator. Following operators are unary
operators:
-, ++, -40. Define binary operator?
A type of operator that works with two operands is known as binary operator. Following operators are binary
operators:
+, -, *, /, %
41. Define compound assignment operator?
C language provides compound assignment operators that combine assignment operator with arithmetic
operators. Compound assignment operators are used to perform mathematical operations more easily.
42. Define increment operator?
The increment operator is used to increase the value of a variable by 1. It is denoted by the symbol ++.
It is a unary operator and works with single variable. Increment operator can be used in two forms:
Prefix form
Postfix form
43. Define decrement operator?
The decrement operator is used to decrement the value of a variable by 1. It is denoted by the symbol --. It is a
unary operator and works with single variable. Decrement operator can be used in two forms:
Prefix form
Postfix form
44. Define relational operator?
The relational operators are used to specify conditions in programs. A relational operator compares two values.
It produces result as true or false. It is also known as comparison operator. Basic relational operators are >, <,
==, >=, <=
45. Define logical operator?
The logical operators are used to evaluate compound conditions. There are three logical operators in C
language:
AND operator (&&)
OR operator (||)
NOT operator (!)
46. Define comment?
Comments are the lines of program that are not executed. The compiler ignores comments and does not include
them in the executable program. Comments can be added in programs in two ways:
Single-line comments
Multi-line comments
47. Define control structure?
A statement used to control the flow of execution in a program is called control structure. The control structures
in C are used to combine individual instructions into a single logical unit.
48. Name different types of control structures?
These control structures are as follows:
Sequence
Selection
Repetition
Function call
49. Define if statement?
“if” is a keyword in C language. “if” statement is a decision-making statement. It is the simplest form or selection
constructs. It is used to execute or skip a statement or set of statement by checking a condition.
Syntax:
if (condition)
statement;
50. Define if-else statement?
“If-else” statement is another type of if statement. It executes one block of statement(s) when the condition is
true and other when it is false.
Syntax:
if (condition)
statement;
else
statement;
51. Define nested if statement?
An if statement with in an if statement is called nested if statement. In nested if structure, the control enters
into the inner if only when the outer condition is true.
Syntax:
If (condition)
If (condition)
{
statement(s);
}
else
{
statement(s);
}
else {
statement(s);
}
52. Define switch statement?
The switch statement is another conditional structure. It is a good alternative of nested if-else statement. It can
be used easily when there are many choices available and only one should be executed.
Syntax:
switch (expression)
{
case 1:
statement;
break;
case 2:
statement;
break;
default:
statement;
}
53. Define conditional operator?
Conditional operator is a decision-making structure. It can be used in place of simple if-else structure. It is also
called ternary operator as it uses three operands.
Syntax:
(condition)? True-case statement: false-case statement;
54. Define Runtime Error?
A type of error that occurs during the execution of program is known as runtime error.
55. What is bug?
An error in a computer program is known as bug. The programmer makes different errors while writing a
program.
56. Define delimiter?
The statements of the program are written in curly braces. The curly braces are known as delimiter.
57. Define data type?
The data type defines a set of values and a set of operation on those values. The computer manipulates various
types of data.
58. What are preprocessor directive?
The Preprocessor directives are commands that give instruction to C preprocessor. The preprocessor directives
are processed by program called preprocessor.
59. What is break statement?
The Break statement is used in body of loop to exist from the loop. When this statement is executed in the loop
body the remaining iteration of the loop are skipped.
60. What are actual parameters?
Actual parameter is used in the function call. There are the actual values pass to function definition in function
call.
61. Define function prototype?
Function declaration is a model of a function. It is also known as function prototype. It provides the information
to the compiler about the structure of function to be used in program.
62. What is scope of local variable?
The area where a variable can be accessed is known as a scope of variable. Local variable can be used in the
function in which it is declared.
63. What is life time of local variable & global variable?
The time period for which a variable exist in the memory is known as the life time of local variable.
Global variable exist in the memory as long as the program is running is called Life time of global variable.