YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 01
Q1. What is data?
Raw facts and figures are called data. It is used to perform certain operations in an
organization. It gives the status of past activities. Data may be numerical like inventory figures,
test scores, etc. Data may be non numerical like your name and address.
Q2. What is information?
Processed data is called information. It is usually output of a process and is meaningful. The
grade of a student in a particular subject in a semester precisely gives the complete information
of the performance of a student.
Q3. What is the difference between data and information?
Data is raw facts whereas information is processed form of data. Data is given to the computer
for input and information is received from the computer in the form of output.
Q4. Define data processing.
Data processing is any computer process that converts data into information or knowledge. The
processing is usually assumed to be automated an running on a computer. It can also be defined
"The manipulation of data to achieve some required objective is called data processing.
Q5. What is data manipulation?
Applying different operations on data is called data manipulation. This operation include
classification, calculation, sorting, and summarizing.
Q6. Define field?
Each column of a table in relational database is called a field. It represents the attributes of the
entity. In table it is represented as a column header.
Q7. Define record.
A collection of related fields treated as a single unit is called record. If we collect different
attributes of a student then it will be called student record.
Q8. Define file.
A collection of related records treated as a single unit is called a file. If we collect the records
of students then collective it will be called a student file.
Q9. Name the file types from usage point of view.
Types of files from usage point of view
• Master file
• Transaction file
• Back up file
Q10. Name the file types from function point of view. Types of files from function point of
view.
• Program files
• Data files
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
11. What is program file?
A file that contains software instructions. The source files and executable files are examples of
program file.
Q12. What do you mean by file organization?
The physical arrangement of records of a file on secondary storage devices is called file
organization. There are a lot of methods to store files on secondary storage. All the methods
have their own advantages and disadvantages.
Q13. Name different types of file organization?
Different types of file organization
• Sequential files
• Direct or random access files
• Indexed sequential files
Q14. What are sequential files?
In sequential files records are stored sequentially. These files store data as it arrives one after
another in the sequence. These files take more time to store data. The best reason for using
sequential files is there degree of portability to other program. The drawback to sequential files
is that you only have sequential access to your data.
Q15. What are direct or random access files?
In random files records are accessed directly without going through the preceding records.
Record in this type of file is stored on a calculate address. In random file the data is stored
exactly as it appears in memory, thus saving processing time.
Q16. What are indexed sequential files?
The data in this type of file can be accessed sequentially as well as randomly based on a key
value. As records are stored in the form of key-pointer pair in the indexed file, therefore, it
requires more space on the disk as compared to random files. It's processing is as fast as random
files.
Q17. What is an index?
A database index is a data structure that improves the speed of operations on a database table.
It is a table created by system developers or DBA containing the key attributes of the table for
which the index is created. Indexes can be created using one or more columns of a database
table, providing the bases for both rapid random lookups and efficient access of ordered
records.
Q18. Define database?
A database is a structured collection of records or data that is stored in a
computer so that a program can consult it to answer queries. The records retrieved in answer to
queries become information that can be used to make decisions. The term database refers to the
collection of related records or related data sets or files, and the software which is used to
manipulate the database is database management system or DBMS.
Q19.What is database management system?
A collection of programs that enables you to store, modify and extract information from a
database. There are many different types of DBMS, ranging from small systems that run on
personal computers to huge systems that run on mainframes. The DBMS is used for large and
medium sized organizations having different types of files for different purposes.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Q20. What is data dictionary?
DBMS uses a file to store the data definition or description of the structure of database is called
data dictionary i.e. data about database. It holds the name, type, range of values, source, and
authorization for access for each data elements in the organization's files and databases.
Q21. What do you mean by consistency constraint?
These are the rules that must be followed to enter data in the database e.g. in name field there
must not be a numerical value, in date of birth field there must be a date.
Q22. What is meant by data independence?
Data independence means that data and application programs are separate from each other.
Physical implementation of data is hidden from application program. DBMS lies between the
application program and database.
Q23. Name some large databases developed.
NADRA, Google, VISA and Amazon books database are a few commonly known large
databases around the world.
Q24. Write down any two disadvantages of database system.
Disadvantages of database system
Additional training is required.
Additional hardware cost.
Additional software cost.
Q25. What are the activities performed on data?
The user of database normally has the following facilities.
Adding new files to the database.
Removing existing files from the database.
Inserting new data into the existing files.
Retrieving data from existing files.
Updating data in existing files.
Deleting data from existing files.
Q26. Name the four major components of database system.
Four major components of database system
Data:
Raw facts that become information after processing.
Hardware:
The physical components of a system it includes:
Input / Output (I/O) Devices.
Primary storage
Secondary storage devices
I/O channels
Processor.
Software:
All kinds of programs which includes:
User / System software
Utilities
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ااحتمانتیکایتریرھگ ھٹب ONLINEویھتا ڈکیمےکاسھتاجری
Personnel:
People who involve with the system:
Programmer / Analyst
End Users
Database Administrator.
اچروںالکزسمہن،دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 02
Q1. Define relation.
In relational database the table in which data is stored is called a relation. Collection of rows
and column is called table. Each intersection of a row and column is called cell. Table contains
the descriptive information about an entity. Table is also called relation. Each file in a file
management system corresponds to a table in database management system.
Q2. What is an Entity?
Anything about which we want to store data is called entity. It can be a person, place or event
etc. Entity always has a unique name with in a domain.
Q3. What is the use of views?
Views are virtual table used to keep data safe and secure from unauthorized access. Unlike
ordinary table in a relational database, a view is not a part of physical schema. It is dynamic,
virtual table computed from data in the database. Changing the data in a table alters the data
shown in view.
Q4. What is a key?
A key field is a field or set of fields of a database table which together form a
unique identifier for a database record. The aggregate of these fields is usually referred to
simply as "the key". A key field also defines searches.
Q5. Define primary key.
In a relation the attribute or a combination of attributes that uniquely identifies a row or a
record. e.g. A social security number, ISBN, student roll number, etc.
Q6. Define secondary key.
A secondary key is a non-unique field that is used as a secondary or alternate key. Some times
records are required to be accessed by a field other than the primary key. In these situations
another key that is used is called secondary key or alternate key.
Q7. Define candidate key.
There can be more than one keys or key combinations that qualify to be selected as primary
key. In a relation there can be only one primary key at a time. Rest of the keys or key
combinations are called candidate keys.
Q8. Define composite key.
Composite key consists of two or more than two fields. Composite key is also designated as a
primary key. It is created in a situation when no single field fulfills the property of uniqueness.
To make unique more than one field are combined and used as primary key.
Q9. Define sort key.
A field or a set of fields in a record that dictates the sequence of the file according to our
requirement. For example the sort keys STATE and NAME arrange the table data
alphabetically by name within state. STATE is the major sort key, and NAME is the minor sort
key.
Q10. What is the use of index file?
Indexes are stored in index file. DBMS uses index files to speed up the sorting and searching
operations.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Q11. Who is end user?
It is the person who uses the database management system for his need. He must have
knowledge of information technology. He does not need to have the detail knowledge of the
computer system. He should be aware of the usage details of the software he intends to use.
Q12. Who is data administrator?
The DA department is responsible for the definition, organization, supervision and protection
of data in order to provide good quality, shareable and accessible data throughout the enterprise.
The Data Administrator manages a staff that is responsible for establishing and implementing
the Data Administration Program.
Q13. Who is database administrator?
A database administrator (DBA) is a person who is responsible for the environmental aspects
of a database. In general, these include:
• Recoverability: Creating and testing backups.
• Integrity: Verifying or helping to verify data integrity.
• Security: Defining and/or implementing access controls to the data.
• Availability: Ensuring maximum up time.
• Performance: Ensuring maximum performance given budgetary constraints.
• Development and testing support: Helping programmers and engineers to efficiently utilize
the database.
Q14. List two properties of a relation.
Properties of a relation.
It has unique column names.
The order of column is insignificant.
The order of row is insignificant.
Q15. Discuss the data manipulation in DBMS system?
Data manipulation of database management system is different from file management system.
In database management system.
Data is stored in relation or tables.
A database may have more than one relation with unique names.
Relations in a database relate to each other using primary and foreign keys.
DBMS uses index to quickly access the data stored in relation.
Database query language i.e. SQL is used for data manipulation in data.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 03
Q1. Define analysis.
A process of studying the existing system is known as analysis. The analysis also determines
what should take place in the new system. It is very important activity for the development of
database system. The person responsible for the requirement analysis is called "Analyst".
Q2. What is the importance of project planning?
Project planning is part of project management. Initially the project scope is defined and the
appropriate methods for completing the project are determined.
Following this steps, the duration for the various tasks necessary to complete the work listed
and grouped into a work breakdown structure. Then the necessary resources can be estimated
and costs for each activity can be allocated to each resource, giving the total project cost.
Q3. What is data modeling?
The identification of data objects and their relationships to other data objects. Data modelling is
often the first step in database design. Designers first create a conceptual model of how data
items relate to each other. Data modeling involves a progression from conceptual model to
logical model to physical schema.
Q4. Define cardinality.
The number of entity occurrences of first entity associated with one or more occurrences of the
second entity is known as cardinality. It is expressed as one or many e.g. a country can have
many cities but a country can have only one capital.
Q5. Define Modality.
Modality defines whether the participation of an entity in a relationship is mandatory or
optional. If a relationship has a cardinality of zero, then is is an optional relationship. If
relationship has cardinality of at least one the relationship is mandatory.
Q6. What is an E-R diagram?
An entity relationship E-R diagram is a specialized graphic that illustrates the interrelationships
between entities in a database. ER diagram often use symbols to represent three different types
of information.
Q7. What is logical database design?
It is the process of mapping the conceptual model to the structures of target DBMS. If the
target database is relational then it will be mapped on normalized relations.
Q8. What is physical database design?
Physical database design is the last step of database design. The objective of physical database
design is to implement the database as a set of stored, records, files, indexes and other data
structures. These data structures provide performance and also ensure data integrity, security
and recoverability.
Q9. What is meant by centralized database distribution?
In centralized database all the data is stored at single location. It is easy but have a few
disadvantages. Data communications may be high in some cases. Data is not readily accessible
by remote users. If central server fails, whole database fails.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Q10. What is partitioned database distribution?
In partition distribution data is divided into fragments and these fragments of data are placed at
different computers. It is more accessible than centralized database strategy.
Q11. What is replicated database distribution?
Full copy of database is stored on some other computer. Any change in parent computer is
replicated to the others. In this strategy more storage is required. There can be a huge
communication cost while replication. Frequent synchronization is also required.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 04
Q1. What is meant by entity integrity?
It is a constraint on entity. Entity integrity is an integrity rule which states that every table must
have a primary key and that the column or columns chosen to be the primary key should be
unique and not null.
A direct consequences of this integrity rule is that duplicate are forbidden in a table. If each
value of a primary key must be unique no duplicate rows can logically appear in a table. This
NOT NULL characteristic of a primary key ensures that a value can be used to identify all rows
in a table.
Q2. What is referential integrity?
It is a constraint on foreign key. If a foreign exists in a relation then either the foreign key value
must match the primary key value of some tuple in its parent table or the foreign key value must
be completely NULL.
Q3. What is redundancy?
Redundancy appears when same data values are stored more than once in a table. It is also
called redundancy if the same values are stored in more than one table.
Q4. What is normalization?
Normalization is s process of converting complex data structures into simple and stable data
structures. It is a technique for reviewing the list of entities and their attributes to ensure that
attributes are stored from where they belong. In other words we can say that it is a process of
analyzing the dependencies of attributes within entities.
Q5. What is repeating group?
Repeating group is a set of one or more data items that may occur a variable number of times in
a tuple.
Q6. What are database anomalies?
These are certain situations created when one or more records are deleted, modified or inserted
in the database and the databases goes into an inconsistent state.
Q7. What is insertion anomaly?
Insertion anomaly occurs when a new record is inserted in the relation. In this anomaly user
cannot insert a fact about an entity until he has an additional fact about another entity.
Q8. What is deletion anomaly?
The deletion anomaly occurs when a record is deleted. In this anomaly the deletion of a record
automatically deletes the fact of another entity.
Q9. What is modification anomaly?
The modification anomaly occurs when the record is updated in the relation. In this case the
modification in the value of specific attribute requires modification in all records in which that
value occurs.
Q10. What is partial dependency?
A type of dependency in which one or more non-key attributes are functionally dependent on a
part of primary key.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Q11. What is transitive dependency?
The transitive dependency is a type of functional dependency between two or more non-key
attributes. It exists if a non-key attribute depends on any other nonkey attribute.
Q12. What is integrity constraint?
Integrity means the correctness and consistency of the data. Integrity is usually expressed in
terms of certain constraints which are the consistency rules that the database is not permitted to
violate. Integrity is also concerned with the quality 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.
Q13. What is 1st Normal form?
A relation is in 1St normal form if and only if all underlying domain contain atomic values
only. Each cell should contain only one value and relation does not contain any repeating group.
Q14. What is 2nd Normal form?
A relation is in 2nd normal form if it is in 1 St normal form and every non-key attribute is fully
functionally dependent on the primary key. All on-key attribute must depend on primary key.
Following are a few conditions for 2ND normal form.
The primary key consist of only one attribute.
No non-key attributes exist in the relation.
Every non-key attribute is functionally dependent on the primary key.
Q15. What is 3rd Normal form?
A relation is in 3rd normal form if it is in 2 ND normal form and no transitive dependencies
exist. Transitive dependency is a functional dependency between two or more non-key
attributes of a relation.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 05
Q1. What is Microsoft Access?
It is one of the most popular and powerful DBMS. It provides the features to the users to create
and maintain databases. We can create tables, forms, queries and reports using MS Access.
Q2. What is wizard?
A wizard is a helper application that makes performing complex tasks easier.
A wizard has a simple decision in a window, which has back and next buttons underneath.
When you have filled in the required data, you click the next button to go to the next window,
or you can click the back button to change your previous decision.
Q3. What is menu bar?
It is the second bar from top. It consists of many words. Each word on this bar represents a
menu. Every word on this bar also has a character underlined. This underlined character
represents the short cut key combination for that particular menu.
Q4. What is database object?
A component of database system is known as database object. These database objects are used
to manage data.
Q5. What is a table?
Table is a collection of rows and columns. All the intersection points of rows and columns are
called cells. In these cells data can be stored. Each column of table represents a field. Each field
is specified to store a particular type of data. Table can be viewed in different ways but most
commonly used are datasheet view and design view.
Q6. What is a query?
Query is a database object used to get data from the database. In query we can specify a certain
criteria to get the required data. The actual objective of data storage is that it can be retrieved
when ever required. Using query object data can also be deleted and updated.
Q7. What is a form?
The window that is used to enter data into the database is called a form.
Using form data can be entered, edited and even viewed in Microsoft Access. Data entered in
forms directly goes to the tables. Forms are always made after table creation. The fields on
forms are linked to the table fields.
Q8. What are reports?
Reports are database objects used to represents queried data in a presentable format. Not all but
most of the RDBMS provides this facility to its users. Reports can be generated on the basis of
tables and queries. We can apply formatting on the reports to make them more presentable and
understandable.
Q9. What is an IDE?
IDE stands for integrated development environment. It is a simple and easy way to do a task. It
presents graphical objects like buttons, icons and menus to perform certain operations. Using
IDE a new user and programmer can easily do their jobs. MS Access also provides the same
facility for its users.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 06
Q1. What is a table?
Table is a collection of rows and columns. Each intersection of row and column is called a cell.
Cell is the place where data is placed. Table is the fundamental object of relational database.
Table is also known as relation. Each row represents a tuple and each column represents an
attribute of an entity. Table or relation itself represents an entity.
Q2. What is meant by degree of relation?
The number of fields of a relation is called the degree of the relation. A table's degree is
specified at the time of creation. But as a rule it can be changed at any time. Change in degree
of a table may cause data loss.
Q3. What is meant by the cardinality of the relation?
The number of records in a table is called the cardinality of that table. Cardinality of a table
changes as new records are added or previous records are deleted. For example a table having
40 rows/records has cardinality 40.
Q4. What are two two table views available in Microsoft Access? Design view and
Datasheet view.
Q5. What is Test data type?
It is the default data type of a field in MS Access. It can contain text or combination of text and
numbers, as well as numbers that don't require calculations, such as phone numbers. Its size is
255 characters or the length set by the FieldSize property, whichever is less. Microsoft Access
does not reserve space for unused portions of a text field.
Q6. What is Memo data type?
A text type field that can contain more than 64000 characters. It is used for long description.
Q7. What is Number data type?
This field is used to store numeric data for mathematical calculations. Size of this data type can
be 1. 2. 4 or 8 bytes (16 bytes if the FieldSize property is set to Replication ID).
Q8. What is AutoNumber data type?
A unique sequential (incremented by 1) number or random number assigned by Microsoft
Access whenever a new record is added to a table. AutoNumber fields can't be updated. Its size
is 4 bytes.
Q9. What is the use of Default view?
In some cases, the value of all records in a certain field is same. A default value can be set in
this case. The user does not need to type the same value again and again. The property set the
default value is used to set default value for a field.
Q10. What is sorting?
Arrangement of data in a particular sequence is called sorting. The sequence can be in
ascending or descending order.
Q11. What is referential integrity?
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Referential integrity is a system of rules that ensures that relationship between records in
related tables are valid and that you don't accidentally delete or change related data. To enforce
referential integrity both tables must have at least one common field, which have same data type
and size.
Q12. What is a query?
A query is a question that requires some data from the database. A query is created by
specifying fields to display their from a table or another query. It can also specify condition for
extracting data. Queries select records from one or more tables in a database.
Q13. What is a join?
A query that extracts data from multiple tables is called join. It uses the relationship of tables to
get data.
Q14. What are wildcards?
Wildcards is a special symbol that is used in queries to search data. Some important wildcards
are *, ? and #. Wildcards characters are meant to be used with fields that have the Text data
type. You can sometimes use them successfully with other data types, such as dates.
Q15. Define criteria in a query?
A condition used to limit the number of rows extracted from database is called criteria. For
example, instead of viewing all the suppliers that your company uses, you can view just
suppliers form China. To do this, you specify criteria that limits the results to records whose
Country field is "China".
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 07
Q1. What is a form?
A window that consists of visual components for input and displays data is called form. A form
is constructed from a collection of individual design elements. These elements are called
controls. The common elements are text boxes, labels, check boxes etc, these elements are used
for different purposes.
Q2. Write a few uses of Form?
Form is used to add data in the database. It is used to delete data from the database. Using form
data can included in the database. Data can be viewed using forms. Data can also be searched
with the help of forms. Forms are also used as a custom dialog box that accepts user input and
carries out an action based on the input.
Q3. What is a sub form?
The sub form is a form that is placed in a parent form. The parent form is called the main form.
Sub form is also called child form. It is useful for the tables when they have relationship of one
to many. The table having foreign key is used for sub-form.
Q4. What is conditional formatting?
The conditional formatting is a special type of formatting. This formatting depends on the
control's value and can be added to text boxes, lists and combo boxes.
Q5. What is a report?
Reports are the output of database application. The user can generate different types of reports
by manipulating the database.
Q6. What is linking?
The process of linking in MS Access creates a link to an object in another database table.
In this method table is not copied from its original location but just linked.
Q7. What is a switch board?
A switchboard is essentially a Microsoft Access form that allows you to facilitate navigation or
perform tasks within your database application. This form is basically a customized menu that
contain user-defined commands, using either buttons, labels, images or hyperlinks, that involve
actions that will automatically carry out tasks for you such as opening other forms, naming
queries or printing reports.
Q8. What is keyboard shortcuts?
Keyboard shortcuts are the combinations of keys that are used to perform different tasks.
They can save time and effort.
Q9. What is input mask?
An input mask controls the value of a cell to store it into a specific format e.g. a database
required to store a date field in a dd/mm/yy format. It will be represented with input mask _/_/_.
Q10. Define tabular form briefly?
In tabular forms multiple records are displayed with fields in columns and records in rows.
Each row represents a record. It is best for the situation when you want to display a few records
and of narrow fields and you want to see several records at the same time.
Q11. Define columnar form?
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Form field and label are displayed side by side in columnar form. In this type of form only one
value is displayed at a time. Columnar form provides a record navigation bar to traverse through
records.
Q12. Define Datasheet form?
A datasheet form displays data in datasheet view, Each row displays one record at a time.
Datasheet form provides record navigation bar to navigate through different records. This type
of form is often used for the basis of sub form.
Q13. What is a list box?
It is a type of text box. Multiple values can be associated with list box and more than one value
can be displayed and selected at the same time.
Q14. What is a combo box?
It is a type text box. Multiple values can be associated with combo box but only one value can
be displayed and selected at a time.
Q15. What is a switch board?
It is a type of form used to display buttons linked to different database objects. These buttons
are used to open, close, or modify those objects.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 08
Q1. What is computer program?
The set of instructions given to the computer to solve a specific problem is called computer
program. Computer can solve problems with the help of computer program. Computer
programs are written in programming languages.
Q2. What is programming language?
Programming language is used to communicate with computer. All computer programs are
written in programming languages. Every programming language has a set of alphabets and
rules. The instructions of computer program are written by using the alphabets and rules defined
by the programming language.
Q3. List different types of programming language.
There are two types of programming languages.
1. Low level languages
2. High level languages
Q4. What is high level language?
A programming language that is close to human language is called high level language. The
instructions written in high level language look like English language sentences. High level
languages are easy to learn and understand.
Q5. What is low level language?
A language that is close to the language of computer. Computer itself uses this language is
called a low level language. There are two types of low level languages.
1. Machine language
2. Assembly language
Q6. What is machine language?
Machine language is also called binary language. There are only two alphabets of machine
language those are zero (0) and one (1). Computer can understand only machine language. The
programs written in other programming languages are first translated to machine language, and
then used on computer. It is called the native language of computer.
Q7. What is assembly language?
It is a programming language in which machine language instructions are replaced by english
like words. These words are known as mnemonics. It is pronounced as Ne- Monic. An assembly
language used english like words. It is easy to write a program in assembly language. It is
mostly used for system software.
Q7. What is source program?
A computer program written in high level language is called source program. Source program
is also called source code.
Q8. What is object program?
A computer program in machine language is called object program. Object program is also
called object code. Machine language is native language of computer so object program directly
runs on computer.
Q9. What is language translator?
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
A language processor is a software that converts a program written in any programming
language into machine language. Every language has its own processor. Language processor is
also called language translator.
Q10. What is compiler?
Software that converts a high level language program into machine language is called
compiler. Every language has its own compiler. First a program is written in high level
language. Then it is given to compiler. Compiler detects and tells about errors is programs.
When high level language program is error free compiler converts it into machine language.
Q11. What is interpreter?
It is a program that converts a source program into object program one statement at a time. It
takes one statement of source program, translates it in machine code and executes it. After the
execution of one statement, it takes next statement and repeat this process till the last instruction
of program.
Q12. What is assembler?
It is a language translator that converts a program written in assembly language into machine
language.
Q13. What is structured programming language?
In structured programming language the program is divided into parts or modules. These
modules are combined to make a complete program. It is easy to write and debug a program
written in structured programming language. There is less chance of error.
Q14. What is unstructured programming language?
In unstructured programming language whole program consists of a single unit. It does not
consist of parts or modules. It is difficult to write and debug a program written in unstructured
programming language. There is more chance of error.
Q15. What is preprocessor?
A compiler is a program that translates a high level language program into machine language.
This process is called compilation. Preprocessor is a program that modifies a C program before
compilation. Preprocessor directives are instructions for the preprocessor.
Q16. What is preprocessor directive?
Preprocessor directives are instructions for the preprocessor. These instructions are written at
the beginning of the program. Every preprocessor directive starts with # symbol. After # symbol
"include" or "define" directives are used. Preprocessor directives are also called compiler
directives.
Q17. What is the work of include directive?
Include is a preprocessor directive. It is used to include header files in to the program. The
relevant header file of the library function, we want to use in programs are mentioned at the
beginning of program by using include directive.
Q18. What is the work of define directive?
Define preprocessor directive is used to define a constant macro. Its general syntax is:
• #define Macro-Name expression
Q19. What is statement terminator?
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Every C language statement ends with semicolon ";". Semicolon at the end of statement is
called statement terminator.
Q20. What are delimiters?
Curly braces at the beginning and end of the main function are called delimiters. C language
statements are written between delimiters.
Q21. What is main function?
Every C language program must contain a main() function. A program with out main function
cannot be executed. Instructions of programs are written between the curly braces {} of main()
function. These statements enclosed in main() function are called body of the main() function.
Q22. What are bugs and debugging?
While writing a program the programmer may come across many errors. The error in a
program is called bug. The process of finding and removing errors is called debugging.
Q23. What is meant by creating a program?
Writing source code statements is called creating C program. Turbo C IDE can be used to
create and edit program. First open Turbo C IDE. Then select new from file menu. A new edit
window will be opened. The cursor blinks in the window. Cursor control keys can be used for
cursor movements. We write the program statements in the window and save it as a program
file.
Q24. What is meant by editing a program?
Writing and editing source program is the first step. Source code is written in C language
according to the type of the problem, in any text editor. Changing source code and removing
errors in the program is called editing a program.
Q25. What is meant by compiling a program?
Computer does not understand C language. It understands only machine language. So C
language code is converted into machine language. The process of converting source code in to
machine code is called compiling. Compiler is a program that compiles source code. If
compiling is successful source program is converted into object program. Object program is
saved on disk. The extension of file is ".obj".
Q26. What is meant by linking a program?
The process of combining required library functions with object program is called linking. This
is done with the help of a program called linker. It is a part of compiler.
The linker combines object program produced by compiler and library function. It produces and
saves a final machine language file. This file is called executable file. The extension of
executable file is ".exe".
Q27. What is meant by executing a program?
The process of running an executable file is called executing. After linking C program can be
executed. A program loader is used to to transfer executable file from secondary storage to main
memory. The program can be executed by selecting run from run menu bar of Turbo C IDE or
by pressing Ctrl + F9 keys from keyboard.
Q28. List name of some high level language.
High level languages
C
C++
C#
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
COBOL
BASIC
FORTRAN
PASCAL
JAVA
Q29. What is Turbo C++?
Turbo C++ is an Integrated development environment (IDE) for creating C and C++ programs.
Borland international has developed it. It is also called TC editor. It is used to create, edit and
save programs. It also has powerful debugging features. These help us in finding and removing
errors from a program. We can easily compile program. Linking a program is also very easy. It
is also used to execute a program.
Q30. What are necessary step to prepare a C program?
Step to prepare a C program
Creating & Editing
Saving
Compiling
Linking
Loading
Running
Q31. What are header files?
Header files are part of C compiler. C language provides many built-in programs. Every
program has a unique name. These programs are called built-in functions or library functions.
Every library function can perform a specific task. We can use these library functions in our C
language program. These functions are divided into groups according to their functionality. A
group of same type of functions are stored in a same file. This file is called header file.
Q32. What is C statement?
Every instruction written in C language program is called a C statement. Every statement ends
with a semicolon ";". Semicolon is called statement terminator.
Q33. What are syntax errors?
The rule for writing a program in a specific programming language is called syntax of the
language. We must follow the syntax of a language. Syntax error occurs when the statements of
program are not according to syntax. Compiler detects syntax errors. If there is a syntax error in
program. It cannot be compiled successfully. Compiler tells about the location and type of
syntax error. Syntax errors can be removed easily.
Q34. What are logical errors?
The error that is due to wrong algorithm is called logical error. These errors occur due to the
wrong logic of program. Compiler cannot detect these errors. A program having logical errors
gives wrong results on execution. These errors are difficult to find, as compiler cannot detect
these errors. The programmer should examine the whole program to find logical errors.
Q35. What are runtime errors?
These errors occur during the execution of program are called runtime errors. When runtime
error occur the execution of program stops and computer shows an error message. These errors
occur when program wants to perform such task that computer cannot perform.
Q36. What is ANSI C?
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
C language is very powerful and flexible language. Wide range of application programs are
written in C language. American National Standard Institute (ANSI) made standard version of
C language in late 1980s. This standard version of C is also called ANSI C. New version of C
has many new features that were not available in older versions.
Q37. List any four advantages of C language?
Advantages of C language
Easy to learn
Easy to Remove Errors
Machine Independence
Standard Syntax
Shorter Programs
Q38. What is meant by machine independence?
A low level language program can run only on the type of computers for which it is written. So
low level languages are machine dependent. A program written in high level language is
machine independent. It can run on all types of computers.
Q39. What is the difference between compiler and interpreter?
Software that converts a high level language program into machine language is called
compiler. Every language has its own compiler. Compiler detects and tells about errors is
programs. When high level language program is error free compiler converts it into machine
language. So compiler is software that converts a source program into object program as a
whole. Object code is used for execution.
It is a program that converts a source program into object program one statement at a time. It
takes one statement of source program, translates it in machine code and executes it. Each time
we execute a program by using its source code.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 09
Q1. What is an identifier?
In a program the names that are used to represent variables, constants, types, functions and
labels are called identifiers. We can use any number of characters as identifiers but the first 31
are significant to C compiler.
Q2. What is user defined identifier?
User defined identifiers are the names assigned by the programmer to functions, data types,
variables etc in a program. For example age, r_no can be user defined identifier in a program.
Q3. What is standard identifier?
The identifier that have a special meaning in C language are called standard identifiers. These
identifiers can be redefined. But this is not recommended. If we redefine a standard identifier in
a program C compiler cannot use it for its original purpose. For example printf and scanf are
standard identifiers.
Q4. What is a keyword?
The words that have predefined meanings and purpose in C language are called keywords of C
language. These are also called reserved words. The purpose of keywords is predefined.
They cannot be used for any other purpose in C language programs. All keywords are written in
lower case. Keywords cannot be used as identifiers. In C language
32 WORDS are defined as keywords.
Q5. What is a variable?
Computer programs are developed to solve different problems. In these problems different
types of data is used as input. Programs process data and generate output.
The data given as input is stored in the main memory for processing. After processing the
results are also stored in main memory. Main memory is a collection of bytes.
These bytes are also called memory locations. So " The named memory locations used to store
input data and result, during the execution of the program is called variable".
Q6. What is a constant?
The quantity whose value cannot be changed during the execution of the program is called
constant. Constants can be declared like variable. To declare a constant 'const' keyword is used.
For example
• const int x = 10;
Q7. What is meant by variable declaration?
Specifying variable name and the type of data it can contain is called variable declaration. C is
a strongly typed language. In C language a variable must be declared before it is used to store
data. If we use a variable with out declaration compiler will generate an error at compile time.
Q8. What is variable initialization?
Storing a value in variable at declaration time, is called initialization. When we declare a
variable some memory is allocated to it, according to its type. This memory already contain
some data. This meaningless is called garbage. If we use variable with out assigning a value the
result will not be correct. We should initialize a variable before using it.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Q9. What is meant by typed language?
Specifying variable name and the type of data it can contain is called variable declaration. C is
a strongly typed language. In C language a variable must be declared before it is used to store
data. If we use a variable with out declaration compiler will generate an error at compile time.
Q10. What are different types of constants?
The quantity whose value cannot be changed during the execution of program is called a
constant. Constant can be declared like variable. To declare a constant 'const' keyword is used.
There are two types of constants in C language.
Numeric constants
Character constants
Q11. What is meant by data type?
Computer programs are used to solve different types of problems with computer. Computer
program take data as input, process it and produce results in the form of output. Computer
program can process different types of data. Data type is defined as the set of values and a set of
operations allowed on those values. It also tells us about the memory required to store that data.
Q12. What is meant by standard data type?
Data types that are defined as the part of the language are called standard data types. For
example int, char, etc are standard data type in C language.
Q13. What is meant by user defined data type?
In addition to standard data types user can define its own data type. These data types are known
as user defined data types. Standard data types can be used in all C language program but user
defined data type can only be used in a program in which it is defined.
Q14. Which data types can be used to store integer data?
Data types for Integers
int
short int
long int
unsigned int
unsigned long int
Q15. Which data types can be used to store floating-point data?
Data types for Real Numbers
float
double
long double
Q16. What is cancellation error?
Cancellation error occurs when an arithmetic operation is performed between very large and a
very small floating point number. Due to this error computer produces unexpected results.
If a large number and a small number are added the large number may cancel out the small
number. For example if we add 1872.0 and 0.0000000005747 the result may be 1872.00000.
Q17. What is meant by underflow?
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
When a value is stored in a variable that is less than its minimum range, that value cannot be
stored in it properly. An error occurs. This error is called underflow error. For example if we
store a number less than -32768 in an int type variable an underflow error will occur.
Q18. What is meant by overflow?
When a value is stored in a variable that is greater than its maximum range, that value cannot
be stored in it properly. An error occurs. This error is called overflow error. For example if we
store a number greater than 32767 in an int type variable an underflow error will occur.
Q19. What is character data type?
To store a character data type chat is used. char type variable use one byte in memory.
Character values are enclosed in single quotes in C language for example
'?', 'a'.
When we store a character in char type variable, ASCII value of that character is stored in it.
ASCII stands for American Standard Code for Information Interchange.
In this code each character is assigned a unique numeric value that value is called ASCII code
for that character.
Q20. How are characters stored?
When we store a character in char type variable, ASCII value of that character is stored in it.
ASCII stands for American Standard Code for Information Interchange.
In this code each character is assigned a unique numeric value that value is called ASCII code
for that character. For example ASCII code of 'A' is 65 and 'B' is 66. As char type variable
contain numeric ASCII code, arithmetic operation can be performed on them.
Q21. What is an operators?
In computer programs we perform different types of operations on data. Operators are symbols
that are used to perform different operation on data. There are different types of operators in C
language. For example + symbol is used to add two numeric values written on both sides.
Q22. What are different types of operators?
Different types of operator available in C language are
• Arithmetic operator
• Relational operator
• Logical operator
• Increment and Decrement operator
• Assignment operator
Q23. What is an arithmetic operator?
The operator that are used to perform arithmetic operation on numeric data are called
arithmetic operators. These operations can operate on numeric variable or constants.
Q24. What is an assignment operator?
The symbol = is called assignment operator. It is used to store a value of a result of an
expression in a variable.
Q25. What is an assignment statement?
A C language statement in which assignment operator is used is called assignment statement.
The general form of an assignment statement is
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
• variable = expression.
It is used to assign a value or result of an expression to a variable. The name of variable is
always written on the left side of assignment operator. The value or expression is always written
on the right side of assignment operator.
Q26. What is compound assignment?
An assignment statement that is used to assign one value to more than one variable is called
compound statement. The assignment operator = is used more than once in this statement. For
example
• A = B = 10;
In above statement a value 10 is assigned to both variables A and B.
Q27. What is compound assignment operator?
A combination of assignment operator with arithmetic operator is called compound assignment
operator. These are also used to perform arithmetic operations.
For example +=. -=, *=, /=, %= are compound assignment operator.
Q28. What is increment operator?
A double plus (++) sign is called increment operator. It is a unary operator. It is used to add 1
to the current value of a variable. It can not be used with a constant or an expression. It can be
used before or after the variable. For example
x++ and ++x are valid but 14++ is not valid.
Q29. What is decrement operator?
A double minus (--) sign is called decrement operator. It is a unary operator. It is used to
subtract one from the current value of a variable. It cannot be used with a constant or an
expression. It can be used before or after the variable name. For example x-- and --x are valid
but 14-- is not valid.
Q30. What is relational expression?
A combination of relational operators and operands is called relational expression.
The operands may be constants or variables. Operands should be of same type. After evaluation
a relational expression generates True or False.
Q31. What are logical operators?
The symbols used in compound expression are called logical operators. AND, OR and NOT
are logical operators available in C language.
Q32. What is logical expression?
A combination of relational expression and logical operators is called a logical expression. It is
used for calculation. Its evaluation gives a single numeric value.
Q33. What is AND operator?
If the relational expression on both sides of AND generates true the final result is true. It is
represented by && symbol.
Q34. What is OR operator?
If any of the relational expression on both sides of OR generates true the result is true. It is
represented by || symbol.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Q35. What is NOT operator?
It is used to convert true to false and false to true. It is represented by ! symbol.
Q36. What is meant by operator precedence?
The order in which different types of operators in an expression are evaluated is called order of
precedence of operator. It is also called hierarchy of operators different types of operators has
different precedence level. The operators having high precedence are evaluated first.
Q37. What is an expression?
A combination of operators and operands is called expression. Expression are used to calculate
the values of formulas. The evaluation of an expression gives a single value. The operands of an
expression may be constants or variable. For example a + b, a
+ 5, and 5 + 6 are all expressions.
Q38. What are comments?
In C language program the lines written between /* and */ are considered as comments. The
compiler ignores these lines. These are used to add remarks in the program.
Comments are also used to explain the logic of the program. Comments are used to increase the
readability of the program. Comments can be added anywhere in the program.
Q39. What is a single line comment?
In C language program the lines written between /* and */ are considered as comments. The
compiler ignores these lines. These are non-executable statements. These are used to add
remarks in the program. If a comment consists of one line it is called single line comment.
Single line comment can be made by the use of // it has no ending it consists of only one line.
Q40. What is multi line comment?
In C language program the lines written between /* and */ are considered as comments. The
compiler ignores these lines. These are nonexecutable statements.
These are used to add remarks in the program. If a comment consists of more than one line then
it is called multi line comment.
Q41. What is prefix increment?
If increment operator is written before the variable name then it is called prefix increment
operator. For example ++x. In this case of prefix increment the value of variable is incremented
by one and then it is used.
Q42. What is postfix increment?
If increment operator is written after the variable name then it is called postfix increment
operator. For example x++. In this case of postfix increment first the value of variable is used
then incremented by 1.
Q43. What is prefix decrement?
If decrement operator is written before the variable name then it is called prefix decrement
operator. For example --x. In this case of prefix decrement first the value of variable is
decremented by one and then it is used.
Q44. What is postfix decrement?
If decrement operator is written after the variable name then it is called postfix decrement
operator. For example x--. In this case of postfix decrement first the value of variable is used
then decremented by 1.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 10
Q1. What is input statement?
The data or instructions given to a program are called input. The data is provided to program by
using some input device. Keyboard is standard input device. The input given by keyboard is
called standard input. The C language instructions that are used to take input are called input
statements.
Q2. What is output statement?
The processed input data produced by program is called output. Output is sent by program to
some output device. The standard output device is monitor. So the output sent to monitor is
called standard output. In C language built-in functions are used for output. The C language
instruction that is used to send output is called output statement.
Q3. What are standard input functions?
Some important functions used for standard input are:
• scanf()
• gets()
• getch()
• getche()
Q4. What are standard output functions?
Some important functions used for standard output are:
• printf()
• puts()
Q5. What are is printf() function?
printf() function is used to send output of the program towards monitor. It can display text,
constants or value of variables on monitor. It can display text, constants and value of variables
in our desired format.
It is also called formatted output function. It is a library function defined in stdio.h header file.
The syntax of printf() function is as follow:
printf("string");
Q6. What is a format specifier?
A string that is used to specify the format in which the value of the variable will display on
monitor is called format specifier. Format specifier start with % symbol.
It is also used to specify the format according to which the values will be displayed on output
device or read from an input device. The general syntax of format specifier is as follow:
• % Flag Field_Width Precision Conversion_Character
Q7. What is field width in format specifier?
The number of columns used to display a value on monitor screen is called field width. A
number in format specifier that determines the field width is called field width specifier. It
specifies the minimum number of columns that should be used to print a value. It used is
optional in format specifier.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Q8. What is an escape sequence?
A combination of characters in printf() function used to control printing on the output device is
called escape sequence. Escape sequence are not printed. Escape sequence begins with
backslash (\).
A specific character is used after backslash. Escape sequence can be used at the beginning,
middle or end of a string. Any number of escape sequence can be used in a string.
Q9. What is getch() function?
This function is used to take a single character as input from keyboard. The character taken
from keyboard is transferred to variable. After typing a character there is no need to press enter
key. It is used to transfer a character to a variable without pressing enter key. The character
typed does not appear on screen.
Q10. What is getche() function?
The function getche() is used to take a single character as input from keyboard. The character
taken from keyboard is transferred to char type variable. After typing a character there is no
need to press enter key. It is used to transfer a character to a variable without pressing enter key.
Q11. What is the function of \n escape sequence?
New line: It is used to move the cursor at the beginning of next line.
For example printf("Hello \n Pakistan");
The output of the above statement will be
Hello
Pakistan
Q12. What is the function of \t escape sequence?
Tab: It is used to move the cursor on one tab forward from current position.
For example printf("Hello \t Pakistan");
output of the above statement will be “Hello Pakistan”
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 11
Q1. What is Control structure?
A control structure is a statement used to control flow of execution in a program or function.
Control structure is used to combine individual instructions in to a single logical unit. This unit
has one entry point and one exit point. Program logic is implemented with the help of control
structures. Three kinds of control structures are used to control flow of execution of
instructions. These are as follow:
Sequence structure
Selection structure
Repetition structure
Q2. What is meant by sequence structure?
In sequence structure the instructions of program executes one after the other in the order in
which the are written. It is also called the default flow of a program. The program starts
execution from the first instruction and all instructions are executed one by one in a sequence.
Q3. What is meant by selection structure?
In selection structure the instructions of the program are divided into two or more groups.
Selected group of instructions are executed. This selection is done after evaluation of a certain
condition.
Q4. What is meant by repetition structure?
Repetition structure is also called iteration structure or loop structure. It is used to execute a
statement or set of statement repeatedly as long as the given condition remains true. This
control structure is used to repeat same or similar work. There are three basic loop structures in
C language. These are as follow:
While loop
Do-while loop
For loop
Q5. What is IF statement?
"if" is a keyword in C language. "if" statement is the simplest form of selection structure. It is
used to execute or skip a statement or a set of statements after testing a condition. The condition
should be a logical or relational expression. After evaluation if the result of condition is true the
statement or set of statements after "if" statement executes. If the result of the condition is false
the statement or the set of statements after "if" statement are skipped. The general syntax of if
statement is
if(condition) Statement;
Q6. What is compound statement?
A set of statements enclosed in curly brackets is called compound statement. It is also called
block of code.
Q7. What is if-else statement?
""if" statement is used to make a decision whether a particular task will be performed or not.
If we want to make a two way decision if-else statement is used. After evaluation of condition
one from two code blocks will be executed and the other will be skipped. We cannot execute or
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
skip both code blocks. The general syntax of if-else statement is if(condition) Statement; else
Statement;
Q8. What is if-else-if statement?
if-else-if statement is used to execute one compound statement from two of more statements. If
there are more than two compound statement and we want to choose one from them if-else-if
statement is used. The general syntax of if-else-if statement is if(condition 1) Statement 1; else
if(condition 2) Statement 2;
else if(condition n) Statement n;. else Default statement;
Q9. What is conditional operator?
Conditional operator is used as an attribute of simple if-else statement. It is used to make two
way decision.
Statement;
} } Q12. What is break statement?
Break is a keyword. It is the last statement in each case. It is used to transfer flow of control
outside a code block. When break statement executes in switch statement the flow of control is
transferred to the first instruction after switch block.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 12
Q1. What is Control structure?
A control structure is a statement used to control flow of execution in a program or function.
Control structure is used to combine individual instructions in to a single logical unit. This unit
has one entry point and one exit point. Program logic is implemented with the help of control
structures. Three kinds of control structures are used to control flow of execution of
instructions. These are as follow:
Sequence structure
Selection structure
Repetition structure
Q2. What is meant by sequence structure?
In sequence structure the instructions of program executes one after the other in the order in
which the are written. It is also called the default flow of a program. The program starts
execution from the first instruction and all instructions are executed one by one in a sequence.
Q3. What is meant by selection structure?
In selection structure the instructions of the program are divided into two or more groups.
Selected group of instructions are executed. This selection is done after evaluation of a certain
condition.
Q4. What is meant by repetition structure?
Repetition structure is also called iteration structure or loop structure. It is used to execute a
statement or set of statement repeatedly as long as the given condition remains true. This
control structure is used to repeat same or similar work. There are three basic loop structures in
C language. These are as follow:
While loop
Do-while loop
For loop
Q5. What is IF statement?
"if" is a keyword in C language. "if" statement is the simplest form of selection structure. It is
used to execute or skip a statement or a set of statements after testing a condition. The condition
should be a logical or relational expression.
After evaluation if the result of condition is true the statement or set of statements after "if"
statement executes. If the result of the condition is false the statement or the set of statements
after "if" statement are skipped. The general syntax of if statement is if(condition) Statement;
Q6. What is compound statement?
A set of statements enclosed in curly brackets is called compound statement. It is also called
block of code.
Q7. What is if-else statement?
""if" statement is used to make a decision whether a particular task will be performed or not. If
we want to make a two way decision if-else statement is used. After evaluation of condition one
from two code blocks will be executed and the other will be skipped. We cannot execute or skip
both code blocks. The general syntax of if-else
statement is if(condition)
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Statement;
else
Statement;
Q8. What is if-else-if statement?
if-else-if statement is used to execute one compound statement from two of more statements. If
there are more than two compound statement and we want to choose one from them if-else-if
statement is used. The general syntax of if-else-if statement is if(condition 1) Statement 1; else
if(condition 2)
Statement 2;
else if(condition n)
Statement n;
else Default statement;
Q9. What is conditional operator?
Conditional operator is used as an attribute of simple if-else statement. It is used to make two
way decision.
The general syntax of conditional operator is
(Condition)? Statement 1 : Statement 2;
Condition should be a logical or relation expression. After evaluation if the result of condition is
true then statement 1 is executed. If result of condition is false then statement 2 is executed.
Q10. What is switch statement?
Switch statement is an alternative of if-else-if statement. It is also a conditional statement. It is
used when we want to execute a block on statements from multiple blocks.
The general syntax of switch statement is
Switch (expression) {
case constant-expression:
statement (s);
break;
case constant-expression:
statement (s);
break;
default:
statement(s);
}
Q11. What is nested if statement?
The use of an "if" statement is used with in another "if" statement is called nested if statement.
The general syntax of nested if statement is If (Condition 1)
{
If (Condition 2)
{
Statement;
}
}
Q12. What is break statement?
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
Break is a keyword. It is the last statement in each case. It is used to transfer flow of control
outside a code block. When break statement executes in switch statement the flow of control is
transferred to the first instruction after switch block.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 13
Q1. What is modular programming?
A programming technique in which a program consists of many independent parts is called
modular programming. These parts are called modules. These parts are also called function.
Each module can perform different tasks. The development speed of a program increases as
different programmers can write different modules of a program. Different modules are
combined to make a complete program.
Q2. What is a function?
In structured programming the program consists of more than more one part. Each part of
program is called a module or function. Every function is given a unique name and it is
developed to perform a specific task. So function can be defined as " A named piece of code
developed to perform a specific task is called function".
Q3. Why functions are used?
Function is a piece of code designed to perform a specific task. There are many advantages of
using functions. These advantages are described below:
Easy programming
Easy modification
Easy debugging
Reuse-ability
Eliminates duplicate code
Less programming time
Q4. What are built-in functions?
The function that are provided as a part of C language are called built-in functions. These
functions are also called library function. A large number of builtin functions are provided by C
language. These functions are stored in different header files. If we want to use a built-in
function in a program the relevant header files is included at the start of the program in
Preprocessor directive.
Q5. What are user defined functions?
The functions that are written by the programmer to perform specific task are called user
defined functions. These functions are written according to the requirement of the program.
Q6. What is function prototypes?
Function declaration is also called function prototype. It is a statement that provides basic
information to compiler about the structure of the function like other C language statement,
function declaration statement also ends with semicolon. Function declaration is necessary like
variable declaration. A function must be declared in a C language program. Function can be
declared before the main() function or inside the main() function.
Q7. What is function definition?
Every function perform some specific task. The task is performed when the set of instructions
execute. Writing set of statements of a function is called function definition. Function definition
is always done outside main() function.
Q8. What is function header?
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
The first line of the function definition is called function header. Its general syntax is as follow:
• Return-Type Name(parameters)
Q9. What is function calling?
The statement that is written to use a function is called function call. A function can be called
at any point in the program. A function is called by using its name. The required parameters are
maintained after the name in braces at the end of the function call statement. Semicolon is used
at the end of statement in which function is called.
Q10. What is return statement?
Keyword "return" is used to return a value from the body of called function to calling function.
The statement in which "return" keyword is used is called return statement. The general syntax
for return statement is as follow: return expression;
Q11. What are parameters?
Parameters are also called arguments. These are the values that are provided to a function when
it is called. when function is called parameters are written after function name in parenthesis.
These parameters can be variables or constants. More than one parameter is separated by
comma.
Q12. What is a local variable?
The variables declared inside main() function, inside any user defined function or header of
function definition are called local variables. Local variable also called automatic variables. The
general syntax to declare a local variable is as follows: auto data-type variables-name;
Q13. What is global variable?
The variables that are declared outside the main() function or any other function are called
global variable. Global variables are also called external variables. Global variables can be used
by all functions in the program. All functions can share their value.
If value of a global variable is changes in a function, that changes value is also available in
other functions.
Q14. What is meant by life time of a variable?
Lifetime of a local variable is limited, when control enters into the function and variable
declaration statement is executed, they are created in memory. When the control exits from the
function these variables are destroyed and their life ends, when variables are destroyed the data
stored in them also becomes inaccessible.
Q15. What is meant by scope of a variable?
Local variables have a limited scope they can only be used in the function in which they are
declared. Compiler generates an error if we want to access a local variable, outside its scope.
Q16. What is scope of global variable?
Global variables can be accessed in all modules of program. They are accessible in main()
function as well as all other user defined functions.
Q17. What is life time of global variable?
When program starts execution, global variables are created in memory. They remain in
memory till the termination of the program. When the program is terminated global variables
are destroyed from the memory. Therefore life time of a global variable is between starting and
termination of program.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
CHAPTER 14
Q1. What is data file?
A data file is a collection of related records. A records is a collection of fields. Any type of data
can be stored in data files. Data in data files is stored permanently.
Q2. What is stream?
The flow of data from one point to another is called a stream. The point from where data is sent
is called source and the point where data is received is called destination.
Q3. What are different types of streams?
There are different types of streams used for transfer of data. These are
Input stream
Output stream
Binary stream
Text stream
Q4. What is text stream?
A flow of characters from a source to a destination is called text stream. In text stream
characters are converted in to bytes. There is no one to one relation between the characters and
the bytes.
The number of characters and the number of bytes may not be same when characters are
converted in to bytes. For example, a new line is stored as a carriage return and line feed pair.
Q5. What is binary stream?
A flow of bytes from a source to a destination is called binary stream. No translation is
required in binary stream. There is one to one correspondence between the bytes read or written
and those on external device. Binary stream is used to transfer any types of data.
Q6. What is input stream?
The flow of data from a source to a program is called input stream. For example C language
program reads data from a data file. This flow of data from data file to C program will be input
stream.
Q7. What is output stream?
The flow of data from a program to a destination is called output stream. For example C
language program write data to a data file. This flow of data from C program to data file is
termed as output stream.
Q8. What is pointer?
Variable are named memory locations used to store data. Different types of variable can store
different types of data. Pointer is a special type of variable. It is not used to store data. It is used
to store memory address used by another variable. Like variable, there are different types of
pointers. The type of pointer should match the type of variable whose address it is holding.
Q9. What is file pointer?
File pointer is a pointer type variable whose type is File. File is a special data type defined in
stdio.h header file. When a file is opened it transfers from secondary storage to main memory.
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201
YOUTH ACADEMY
اکیالھکوٹسڈسٹنوکآنالنئایتریرکواےنواالوادحادارہ
ویھتا ڈکیمےکاسھتاجریONLINE ااحتمانتیکایتریرھگ ھٹب
File pointer variable contain information about an opened file. Data files can be accessed with
the help of File pointer. File pointer is used to read and write in a data file.
Q10. What is meant by EOF?
Text files are stored on secondary storage. Different files have different size. A special end of
file marker is used at the end of each text file. This marker is placed after the last character of
text file. In C language is is denoted by EOF. EOF is used to detect the end of file.
Q11. What is a string?
A collection of character enclosed in double quotations is called a string.
The variable that is used to store a string is called string variable. C language
does not provide any special data type to store string. As string is a combination of characters, a
char array is used to store string.
Q12. What is the purpose of fopen() function?
A file must be opened before use. We can read from or write into a file only if it is opened.
Files are permanently stored on secondary storage. When a file is opened it's data is transferred
in main memory.
Header file stdio.h contain all standards file handling functions. fopen() function is used to open
a file. A file pointer is attached with an open file.
Q13. What is the purpose of fputs() function
fputs() function is used to write a string in text file. This function is defined in stdio.h header
file before the use of this function the file must be open in write mode or append mode. The
general syntax of this function is as follow
• fputs( string, file pointer);
Q14. What is the purpose of fgets() function
fgets() function is used to read a sting from a text file. This function is defined in stdio.h header
file. Before the use of this function the file must be opened in read mode. The general syntax of
this function is as follow:
• fgets( str, n, file pointer);
Q15. What is the purpose of putc() function
The putc() function is used to write a single character into text file at one time. Before the use
of this function file should be opened is write or append mode. The syntax of this function is as
follow: • putc( character, file pointer);
Q16. What is the purpose of getc() function
getc() function is used to read a single character from a file. More than one characters can be
read from a file by using this function repeatedly. Before the use of this function the file must
be opened in read mode.
Q17. What is the purpose of fprintf() function
The fprintf() function is used to write data in a file in specified format. Any type of data can be
written in a file. The file must be opened in write or append mode before the use of this
function. Its general syntax is as follow:
• fprintf( fp, Format_string, argument);
دمہایگروہںیاورابروہںیےکےئلڈاٹیرفامہرکےنواالوادحادارہ،اچروںالکزسمہن
سیگرپیپزاورریپگنمیکسےکےیلویھتا ڈکیمویویٹبلنیچوزٹرکںی
WHASTSAPP GROUP 0346-6116201