0% found this document useful (0 votes)
25 views

2nd Year One File Notes

Notes for Intermediate part 2 Computer I think... kindly confirm first the subject of file

Uploaded by

tsarwar222
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

2nd Year One File Notes

Notes for Intermediate part 2 Computer I think... kindly confirm first the subject of file

Uploaded by

tsarwar222
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA

CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY


____________________________________________________________________________________________

CHAP#1
CHOOSE CORRECT OPTIONS
1. A set of related records that represents a unit of data is:
(A)File (B)Record (C)Field (D)Database
2. The manipulated and processed data is called:
(A)Object (B)Information (C)Data (D)None
3. The process of arranging data in a logical sequence is called:
(A)Sorting (B)Summarizing (C)Data capturing (D)Classifying
4. Storage and retrieval of data is related to:
(A)Data capturing (B)Data manipulation (C)Managing output result (D)None
5. A collection of raw facts and figures is called:
(A)Data (B)Information (C)Processing (D)None
6. The smallest meaningful unit of data in a database is called:
(A)Byte (B)Record (C)Character (D)Field
7. Which of the following type of file require largest processing time?
(A)Sequential file (B)Random file (C)Indexed sequential file (D)Direct access file
8. Which of the following may be a temporary file?
(A)Master file (B)Transaction file (C)Backup file (D)None of these
9. A collection of related fields is:
(A)File (B)Record (C)Database (D)None
10. A logical grouping of characters is a:
(A)Filed (B)Record (C)File (D)All
11. A ......... can store text only.
(A)Binary (B)Text file (C)Exe file (D)Object file
12. In text file, data is stored in:
(A)ASCII code (B)Binary code (C)Octal code (D)Text code
13. In relational database, a single piece of information is called:
(A)Field (B)Record (C)Entity (D)Attribute
14. Data can be recovered in case of loss by using:
(A)Master file (B)Transaction file (C)Backup file (D)Data file
15. A database containing all students in a class would store basic data of students in:
(A)Record (B)Filed (C)Cell (D)File
16. Which file is used to store information that remains constant for a long time:
(A)Data file (B)Master file (C)Transaction file (D)Backup file
17. The extension of image file is:
(A).exl (B).doc (C).bmp (D).ppt
18. Which of the following represents a collection of concepts that are used to describe the structure of a database?
(A)Data warehouse (B)Data model (C)Data structure (D)Data type
19. Which of the following data model is more flexible?
(A)Network data model (B)Hierarchical data model (C)Relational data model (D)Object data model
20. A database is an organized collection of ......... related data.
(A)Logically (B)Physically (C)Loosely (D)Badly
24. Which of the following database model is also referred an inverted tree?
(A)Hierarchal (B)Network (C)Relational (D)Object
25. Which one refers to the correctness and consistency of data?
(A)Data independence (B)Data integration (C)Data integrity (D)Data model
26. Data inconsistency is a caused by:
(A)Organized data (B)Integrated data (C)Independent data (D)Redundant data
27. Multiple copies of the same data is referred to as:
(A)Data integrity (B)Data inconsistency (C)Data redundancy (D)Data isolation
28. SQL is a(n):
(A)Unstructured language (B)Structured language
(C)Object oriented language (D)Software
29. SQL stands for:
(A)Sort-Query-List (B)Self-Quantifying-Language
(C)Structured Query language (D)Self Quantities language

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

SHORT QUESTIONS

1. Differentiate between data and information.


2. Describe data capturing.
3. Describe data manipulation.
4. What is sorting?
5. What is meant by reproduction?
6. What is file?
7. List the file types from usage point of view.
8. What is master file?
9. List the file types from function point of view.
10. Define program file with example.
11. What is meant by file organization?
12. Differentiate between master file and transaction file.
13. What are the problem with sequential file?
14. Define index sequential file.
15. Define the term redundancy.
16. How data inconsistency occur?
17. Define database.
18. List different objectives of the database.
19. Define data integration.
20. Explain the term program data independence.
21. Define data integrity.
22. Enlist different types of database models.
23. Describe network model.
24. Explain relational model.
25. What is DBMS?
26. Write any two objectives of database management system.
27. List down any two features of DBMS.
28. Define consistency constraints.
29. Define data dictionary.
30. State the use of query language.
31. Why is report generator used in database system?
32. What is the purpose of backup and recovery?

LONG QUESTIONS

1. What activities are involved in data processing? Discuss in details.


2. Explain file type from usage point of view.
3. Explain file type from storage point of view.
4. What is file processing? Explain different types of problems that occur in traditional file system,
5. What are the four major components of the database system? Write in details.
6. What is database model? Explain three types of database models.
7. Explain four advantages and disadvantages of the DBMS?
8. Explain features of DBMS.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#2
CHOOSE CORRECT OPTIONS
1. Insert command is used to insert:
(A)A new table (B)A new record (C)A view (D)Dependencies
2. CREATE command is used to create a:
(A)Table (B)View (C)Report (D)Query
3. An attribute is also known as a:
(A)Table (B)Relation (C)Row (D)Field
4. A category of data or information that describes an entity is called a(n):
(A)Attribute (B)Data item (C)Record (D)Tuple
5. The row of relation can be of ......... order.
(A)Any (B)Same (C)Sorted (D)Constant
6. A relation is analogous to a:
(A)Table (B)Field (C)Record (D)Row
7. Which of the following is degree of a table?
(A)Total number of rows (B)Total number of columns (C)Total number of cells (D)Total number of foreign keys
8. The row of table is also called:
(A)Entity (B)Attributes (C)Cell (D)Record
9. The columns of a table correspond to:
(A)Table (B)Record (C)Field (D)Cell
10. Which of the following is not included in the definition of entity?
(A)Person (B)Object (C)Concept (D)Action
11. In MS Access, table contains:
(A)Fields (B)Record (C)Character (D)File
13. Views are also called:
(A)Complex tables (B)Simple tables (C)Virtual tables (D)Actual tables
14. To find all names start with M from student table, the criteria is:
(A)Like “M?” (B)Like “M – ” (C)Like “M# ” (D)Like “M * ”
15. A virtual table that is constructed form other tables is called:
(A)Tuple (B)Table (C)View (D)Report
16. The foreign key is found in:
(A)Parent table (B)Dependent table (C)Pivot table (D)Index table
17. A table must have:
(A)Primary key (B)Secondary key (C)Composite key (D)Sort key
18. A key that consists more than one attributes is called:
(A)Foreign key (B)Composite key (C)Primary key (D)Control key
19. The selected candidate key is called:
(A)Foreign key (B)Composite key (C)Primary key (D)Sort key
20. Which of the following is also known as control key?
(A)Sort key (B)Composite key (C)Candidate key (D)Primary key
21. ......... key does not hold uniqueness property.
(A)Foreign (B)Candidate (C)Primary (D)Secondary
22. How many primary keys can a relation have?
(A)At least once (B)Only one (C)No limit (D)Three

SHORT QUESTIONS

14. Define secondary key. Give example.


1. Define field. 15. Define alternate key. Give example.
2. Define fix length field and variable length field. 16. Define composite key. Give example.
3. How a relation is formed in database? 17. Define foreign key.
4. Define the term table or relation. 18. Define candidate key/alternate key?
5. Enlist 4 different properties of a relation. 19. Describe composite key/concatenate key?
6. Define entity. 20. Who is a user or ender user?
7. Give example of entity. 21. Who is a data administrator?
8. Write down the basic purpose of using views? 22. Write three responsibilities of a database administrator.
9. Define indexes. 23. Who is a database administrator?
10. State the purpose of index file. 24. What is the usage of index in FMS and DBMS?
11. What is key?
12. List different types of keys.
13. Define primary key. Give example.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#3
CHOOSE CORRECT OPTIONS
1. All the hardware costs are considered during:
(A)Project planning (B)Requirements analysis (C)Feasibility study (D)Data analysis
2. An entity related to itself in an ERD model refers to:
(A)Recursive relationship (B)One-to-many relationship (C)Many-to-many relationship (D)One-to-one relationship
3. In ERD model, the relationship between two entities is represented by a:
(A)Diamond symbol (B)Rectangular box (C)Oval symbol (D)Line
4. In an E-R diagram, a rectangle represents a(n):
(A)Entity (B)Attribute (C)Relationship (D)None
5. ......... is used to define characteristics of an entity/object.
(A)Object (B)Attributes (C)Records (D)Files
6. In an E-R diagram, a diamond represents a(n):
(A)Attributes (B)Relationship (C)Entity (D)Modality
7. Customers, cars and parts are examples of:
(A)Entities (B)Attribute (C)Cardinals (D)Relationships
8. Which one is not related to an entity?
(A)Person (B)Concept (C)Action (D)Object
9. Color of car is an example of:
(A)Entity (B)Attributes (C)Relation (D)Relationship
10. Which one of the following is used to associate entities with each other?
(A)Attributes (B)Relationship (C)Entities (D)Cardinals/Identifier
11. An entity related to itself in an ERD model refers to relationship:
(A)Recursive (B)One to many (C)Many to many (D)One to one
12. A relationship between countries and capitals is an example of relationship:
(A)One-to-one (B)One-to-Many (C)Many-to-Many (D)Many-to-One
13. Which of the following defines the nature of the relationship?
(A)Modality (B)Decision tree (C)Both A & B (D)None
14. In hybrid distribution which kind of fragments are stored at only one site:
(A)Critical fragments (B)Non-critical fragments (C)Critical and non-critical fragments (D)Only large fragments
15. Which of the following is not a basic data distribution strategy?
(A)Centralized (B)Partitioned (C)Replicated (D)Duplicated
16. Database development process involve mapping of conceptual data model into:
(A)Object oriented data model (B)Network data model (C)Implementation model (D)Hierarchical data model

SHORT QUESTIONS
1. Write the purpose of feasibility study
2. Define the term analysis. 12. Define recursive relationship give example.
3. What is the importance of project planning? 13. Define cardinality.
4. Which activities are involved in data analysis? 14. Define modality.
5. What is meant by data modeling? 15. Differentiate between cardinality and modality.
6. Define entity or object. 16. Write the use of ER diagram.
7. Define an attribute. Give an example. 17. Name the symbols used in E-R model for attribute and
8. Define relationship. entity.
9. How relation is formed in database? 18. State the purpose of database design process.
10. Name different types of relationship. 19. State the purpose of physical database design.
11. Give one examples of one-to-one relationship. 20. List any two data distribution strategies.

LONG QUESTIONS
1. Define the term analysis. Briefly discuss the following terms: i) Feasibility study ii) Requirement analysis iii) Project
planning iv) Data analysis
2. What is data modeling? Explain ingredients of data modeling.
3. What is E-R diagram? Give an example of E-R diagram.
4. What are the components of a logical data model?
5. Briefly explain the database design process with the help of a diagram.
6. Explain different data distribution strategies.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#4
CHOOSE CORRECT OPTIONS
1. In 3NF, which form of dependency is removed?
(A)Functional (B)Non-functional (C)Associative (D)Transitive
2. In 3NF, a non-key attribute must not depend on a(n):
(A)Non-key attribute (B)Key attribute (C)Composite key (D)Sort key
3. Different attributes in two different tables having same name are referred to as:
(A)Synonym (B)Homonym (C)Acronym (D)Mutually exclusive
4. Every relation must have a:
(A)Primary key (B)Candidate key (C)Secondary key (D)Composite key
5. Transitive dependency is removed in:
(A)1st normal form (B)2nd normal form (C)3rd normal form (D)4th normal form
6. The goal of normalization is to:
(A)Increase (B)Increase inconsistency redundancy (C)Get stable (D)Increasing anomalies data structure
7. Two or more attributes having different names but same meaning is called:
(A)Homonyms (B)Aliases (C)Synonyms (D)Alternate attributes
8. In 2NF, which form of dependency is removed?
(A)Functional (B)Partial (C)Associative (D)Transitive
9. Referential integrity is applied on:
(A)Foreign key (B)Composite key (C)Primary key (D)Sort key
10. A primary key that consists of two or more attributes of a relation is called:
(A)Sort key (B)Candidate key (C)Sub key (D)Composite key
11. The entity integrity rule states that:
(A)No primary key attribute can be null (B)Each entity must have a primary key (C)Primary key must have only one attribute (D)None
12. A rule that states that each foreign key value must match a primary key value in the other relation is called:
(A)Referential integrity constraint (B)Key match rule (C)Entity key group rule (D)Foreign/primary match rule
13. A constraint between two attributes is called a(n):
(A)Functional relation (B)Attribute dependency (C)Functional dependency (D)Functional relation constraint
14. The attribute on the left-hand side of the arrow in a functional dependency is:
(A)Candidate key (B)Determinant (C)Foreign key (D)Primary key
15. A relation is in 2NF if it is in 1NF and all its NO non-key attribute are:
(A)Dependent on part of the primary key(B)Dependent on the primary key(C)Independent of the primary key(D)Independent of any other relation
16. Which of the following are anomalies that can be caused by redundancy in tables?
(A)Insertion (B)Deletion (C)Modification (D)All
17. A functional dependency between two or more non-key attributes is called:
(A)Partial functional dependency (B)Partial non-key dependency (C)Transitive dependency (D)None
18. Which of the following anomalies result from a transitive dependency?
(A)Insertion (B)Modification (C)Deleting (D)All
19. A relation is in third normal form if it is in second normal form and:
(A)Dependent on part of the key (B)Dependent on all of the key (C)Independent of the key (D)Has no transitive
dependencies
20. A relation that contains minimal redundancy and allows easy use is called:
(A)Clean (B)Simple (C)Complex (D)Well-structured
21. The 1NF describe the tabular format in which:
(A)All the key attributes are defined (B)No repeating groups in the table (C)All attributes are dependent on primary key (D)All
SHORT QUESTIONS
1. What is meant by data integrity?
2. What do we do to attain entity integrity? 8. Define homonym with example.
3. What is meant by entity integrity? 9. Describe mutual exclusiveness of data.
4. What is meant by referential integrity? 10. How first normal form is achieved?
5. How referential integrity attain? 11. How second normal form is achieved?
6. Explain normalization. 12. What is determinant?
7. Define synonym with example. 13. Describe partial dependency.
14. Write types of anomalies.
15. Define insertion anomaly.
16. Define 3rd normal form.
17. Describe transitive dependency.

LONG QUESTIONS
1. Explain the following terms: synonym, homonym, redundancy, mutual exclusiveness of data
2. When is a relation in first normal form? Explain with examples.
3. What are the database anomalies? Briefly discuss insertion, deletion and modification anomalies.
4. Define functional dependency? How partial dependencies effect a relation?

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#5
CHOOSE CORRECT OPTIONS
1. Microsoft access saves the database with the extension:
(A).mdb (B).msdb (C).madb (D)None of them
2. Which shortcut key is used to open an existing database in MS Access?
(A)Ctrl + N (B)Ctrl + S (C)Ctrl + O (D)Ctrl + Z
3. It makes very simple to create a database:
(A)Sample database (B)Wizard (C)Common standard (D)Easier programming
4. MS Access saves the database with the extension:
(A).mbdq (B).msdb (C).ppt (D).mdb
5. In relational database, a table is called:
(A)Tuple (B)Relation (C)File (D)Scheme
6. A set of related files created and managed by a DBMS is called:
(A)Field (B)Record (C)Database (D)Module
7. A database consists of various components called the:
(A)Tool (B)Properties (C)Entities (D)Object
8. Which of the following object of database is used to retrieve data from database?
(A)Queries (B)Forms (C)Reports (D)Tables
9. The output of a query is in the form of a:
(A)Table (B)Form (C)Report (D)Query
10. Which of the following object is used to retrieve data from database and present in a formatted away?
(A)Report (B)Form (C)Table (D)Query
11. A record is a complete set of ......... field.
(A)Distinct (B)Related (C)Designed (D)All of them
12. In access, the structure of a table is created in ......... view.
(A)Design view (B)Datasheet view (C)Both A & B (D)None of them
13. Which object is the output of a database application?
(A)Form (B)Query (C)Table (D)Report
14. A database consists of various components called:
(A)Tools (B)Properties (C)Entities (D)Objects
15. Which object is used to store data in database?
(A)Macro (B)Table (C)Form (D)Report
16. The output of the query is in the form of:
(A)Table (B)Form (C)Report (D)Query
18. Which of the following is not a database object?
(A)Table (B)Query (C)Report (D)MS Word
19. The example of popular DBMS is:
(A)MS Word (B)MS Access (C)MS Excel (D)MS PowerPoint
20. The graphical query tool is known as:
(A)Query grid (B)Design grid (C)Query form (D)Design form

SHORT QUESTIONS
1. What is Microsoft Access?
2. List down any two advantages of Microsoft Access. 14. List different buttons available on Access database window.
3. Define the term RDBMS. 15. Differentiate between form and report.
4. List any four properties of relational database management 16. Define database object.
system. 17. Define two database objects.
5. What is database wizard? 18. What is the role of query in database?
6. Define the term redundancy. 19. How is a query written?
7. Differentiate between toolbar and menu bar. 20. Define a form.
8. Define the use of toolbar in Microsoft access. 21. Write two advantages of form.
9. Name any for parts of MS Access application window. 22. Write definition of reports.
10. Describe menu bar. 23. List any two uses of reports.
11. Define scroll bar. 24. Differentiate between query and report.
12. What is the use of title bar in MS Access?
13. What is an IDE?

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#6
CHOOSE CORRECT OPTIONS
1. In a relational database, a single piece of information is called:
(A)Field (B)Record (C)Entity (D)Attribute
2. The degree of relation refers to the number of:
(A)Rows (B)Tables (C)Field (D)Columns
3. Each set of related items in a table is called:
(A)Table (B)Record (C)Field (D)Query
4. The data in table is entered in:
(A)Design view (B)Normal view (C)Datasheet view (D)Layout view
5. How many table views are available in Microsoft access?
(A)4 (B)3 (C)2 (D)1
6. As in design view, you can move from field to field in the table window in datasheet view using ......... button.
(A)Tab (B)Esc (C)Enter (D)Spacebar
7. ......... table views are available in Microsoft Access.
(A)1 (B)2 (C)3 (D)4
8. To find a four-character name that starts with H, the criteria is specified as:
(A)H*4 (B)H?4 (C)H??? (D)H####
9. What is the default field size of a Text data type in MS-Access?
(A)2 (B)5 (C)20 (D)50
10. Which data type is default type in Access?
(A)Memo (B)Number (C)Text (D)Auto number
11. Create command is used to create:
(A)Table (B)View (C)Report (D)Query
12. Every table must have a:
(A)Foreign key (B)Composite key (C)Primary key (D)Sort key
13. Which data type can be used to define a field that consists of only numbers to be used in calculations?
(A)Text (B)Memo (C)Number (D)Date/time
14. Which of the following buttons of find and replace dialog box is clicked to start the search process?
(A)Find (B)Find next (C)Search (D)Next
15. Which view is used to add, edit or delete record from table?
(A)Record view (B)Datasheet view (C)Design view (D)Edit view
16. The column of a table corresponds to:
(A)Table (B)Field (C)Record (D)Cell
17. Which symbol indicates that you are editing a record?
(A)Pencil (B)Black arrow (C)Key (D)Asterisk
18. How many types of relationship?
(A)2 (B)3 (C)4 (D)5
19. The rule that a record from a table cannot be deleted if it’s associated record exits in a related table is called ......... rule.
(A)Referential integrity (B)Entity–relationship (C)Normalization (D)All of them
20. The relationship between countries and their capitals is an example of ......... relationships.
(A)One-to-one (B)One-to-many (C)Many-to-many (D)None of them
21. What command is required to actually execute a filter on a table?
(A)Remove filter (B)Apply filter (C)Clear grid( D)Find next
22. Which filtering method allows you to use data in a field as criterion for filtering?
(A)Filter by form (B)Apply filter (C)Clear grid (D)Find next
23. Which of the following is an example of a filter by form expression?
(A)Abdullah (B)1985 (C)4 OR 5 (D)None
24. What is Z to A order called?
(A)Ascending (B)Descending (C)Condescending (D)Alphabetical
25. The Sort Ascending button will:
(A)Order all records alphabetically (B)Order all records reverse alphabetically (C)Filter out selected records (D)Delete selected
records
26. The wildcard ......... Sal[ei]ma.
(A)Saleema (B)Salima (C)Both A & B( D)None of them
27. Which wildcard replaces one character only?
(A)* (B)? (C)null (D)!

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

28. The graphically query tool is known as:


(A)Query grid (B)Design grid (C)Query form (D)View form
29. How many query views are available in MS Access?
(A)2 (B)3 (C)4 (D)5
30. To find a name that start with S, the criteria is written as:
(A)S # ? (B)S # (C)? S (D)S *
31. ......... is used to retrieve data from one or more tables.
(A)Macro (B)Table (C)Query (D)Form

SHORT QUESTIONS

1. Define relation.
2. Define the term degree of relation.
3. Difference between degree of relation and cardinality of relation.
4. Define IDE.
5. List two disadvantages of integrated development environment.
6. Name two table views available in Access.
7. What is the use of datasheet view in MS Access?
8. How a new record is added to a table using datasheet view?
9. Name three methods for creating tables in MS Access.
10. What is OLE object in MS Access?
11. List any four field properties.
12. What is the use of input mask?
13. Differentiate between relationships and join.
14. What is filter.
15. Define join.
16. Differentiate between sorting and filtering.
17. Write down the use of filters in MS Access.
18. What are wildcards?
19. Discuss the use of design view in MS Access.
20. Write a query to display all the records from a table Employee.
21. What is the purpose of query?
22. List some advantage of query.

LONG QUESTIONS

1. What is table? Write down six characteristics of table.


2. Explain different data types available in MS Access.
3. Discuss any four different methods of modifying a table.
4. What is filter? Discuss different types of filter used in MS Access.
5. Define the various types of queries.
6. What is query? Discuss its three uses and three advantages.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#7
CHOOSE CORRECT OPTIONS
1. Forms are designed for:
(A)Input data (B)Manipulate data (C)Accepting change (D)All of them
2. How many are basic layouts of forms in Microsoft access?
(A)2 (B)3 (C)4 (D)5
3. The forms are the ......... end of our database in Microsoft access.
(A)Back (B)Front (C)Both A & B (D)None of these
4. A ......... auto form displays one record at a time.
(A)Tabular (B)Columnar (C)Datasheet (D)Justified
5. A form that contains a sub form is called:
(A)Form (B)Main form (C)Report (D)Child form
6. A form within another form is called:
(A)Sub-form (B)Main form (C)Multi-form (D)None
7. A sub form can be created using:
(A)The form wizard (B)Drag and drop method (C)Sub form wizard (D)All of these
8. Which of the following is a one-to-many relation?
(A)Student-Reg no .(B)Mother-Daughter (C)Person-Date of birth (D)Country-Capital
9. A report may be based on:
(A)Table (B)Relationship (C)Form (D)Attributes
10. How many reports layouts are?
(A)2 (B)3 (C)4 (D)5
11. Which of the following is used to retrieve data from database and represent it to the user in a formatted way?
(A)Form (B)Query (C)Table (D)Report
12. You can drag the ......... bar to move the property sheet window around on your screen.
(A)Title bar (B)Status bar (C)Scroll bar (D)All of them
13. A report provides a column for each field of the records in rows under the column header is known as:
(A)Tabular (B)Columnar (C)Datasheet (D)Justified
14. ......... can be previewed on the screen before printing.
(A)Report (B)Form (C)Sub form (D)None of them

SHORT QUESTIONS

1. Define form. 9. Differentiate between combo box and list box.


2. List any two types of forms used in MS Access. 10. State the purpose of radio button.
3. Write use of columnar form in MS Access. 11. What is sub form?
4. What are tabular form? 12. List any two methods of creating sub forms.
5. What is auto form? 13. Distinguish between form and sub form.
6. Discuss the use of design view in MS Access. 14. What is a report?
7. Define list box. 15. What is linking in MS Access?
8. Define combo box. 16. Write the use of switchboard.

LONG QUESTIONS
1. What is form? Explain different types of form in detail.
2. When is report? Explain different types of report also write uses of report.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#8

CHOOSE CORRECT OPTIONS


1.C is a:
(A)High level language (B)Low level language (C)Assembly language (D)Machine language
2. C was designed to write programs for:
(A)Windows operating system (B)Solaris operating system (C)Unix operating system (D)OS/2 operating system
3. C-language was developed in:
(A)1962 (B)1969 (C)1970 (D)1972
4. Turbo C++ can compile:
(A)C++ programs only (B) C and C++ programs (C)Turbo C programs only (D)Turbo C++ programs only
5. .exe file is produced by the:
(A)Linker (B)Loader (C)Compiler (D)Interpreter
6. Which of the following key is used to save a file?
(A)F2 (B)F3 (C)F5 (D)F9
7. The extension of C source program is:
(A).h (B).c (C).obj (D).exe
8. The process of converting source code into object code is knows as:
(A)Compiling (B)Executing (C)Linking (D)Saving
9. C statement end with a:
(A)Period (B)Comma (C)Colon (D)Semicolon
10. C-Language programs are divided into units called:
(A)Section (B)Syntax (C)Function (D)Debug
11. The statements written by programmer are called:
(A)Source code (B)Object code (C)Syntax (D)Debugging
12. The target code produced by the compiler is:
(A)Object code (B)Source code (C)Library code (D)Linked code
13. The output of the compiler is called:
(A)Library code (B)Source code (C)Linked code (D)Object code
14. C language was developed by:
(A)Bill Gates (B)Denis Ritchie (C)Switch (D)For
15. Preprocessor directives are commands for:
(A)Microprocessor (B)Language processor (C) C preprocessor (D)Loader
16. The expression in define directive:
(A)Can only be changed at the end of the program (B)Cannot be changed
(C)Cannot be changed but can be redefine (D)Cannot be assigned a value
17. Void occupies how many bytes in memory?
(A)Zero (B)One (C)Two (D)Four
18. Which of the following is used to donate preprocessor directives?
(A)% (B)$ (C)# (D)@
19. Header files in C contain:
(A)Compiler commands (B)Library functions (C)Header information of C programs(D)Operators for files
20. Which header file contains information about standard input/output functions?
(A)Stdio.h (B)Conio.h (C)String.h (D)Math.h
21. The name of header file is written between:
(A)[ ] (B)( ) (C)<> (D)<< >>
22. The extension of the header file is:
(A).c (B).txt (C).hf (D).h
23. A table is a two dimensional structure that consists of:
(A)X and Y coordinates (B)Matrix elements (C)Rows and columns (D)Intersection of data
24. Stdio.h stands for:
(A)Standard input output (B)Symbolic input output (C)Simple input output (D)String input output

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

25. Debug is the process of:


(A)Creating bugs in program (B)Identifying and removing errors(C)Identifying errors (D)Removing errors
26. A program syntax error is detected by:
(A)Linker (B)Compiler (C)Loader (D)Debugger
27. Which of the following language requires no translator to execute the program:
(A)C (B)C++ (C)Machine language (D)Assembly language
28. The lowest level of programming language is:
(A)Java (B)Assembly language (C)Pascal (D)C++
29. Which of the following is not a low level language?
(A)BASIC (B)Machine (C)Assembly (D)None of these
30. .exe file is created by:
(A)linker (B)Compiler (C)Loader (D)None of these

SHORT QUESTIONS
1. Define program. 22. Differentiate between linking and loading.
2. Who is programmer? 23. Differentiate between linker and loader.
3. What are programming languages? Enlist four High 24. Differentiate b/w .c and .cpp.
level programming language. 25. What is #define directives?
4. Name two main categories of programming 26. What are preprocessor directives?
language. 27. Define include directive with example
5. Define machine language. 28. What is header file? Write down its syntax and
6. Why does machine language program executes example.
faster that high level language? 29. Explain constant macro with example.
7. Define assembly language. 30. What is the use of main() function in C programs?
8. Define assembler. 31. What do you mean by delimiters?
9. What is the difference between machine language 32. What do you know about C statement?
and assembly language? 33. What is statement terminator?
10. Differentiate between compiler and interpreter. 34. Differentiate b/w bug and debugging.
11. Define object code. 35. What are different types of errors in C
12. Define source code. programming?
13. Why source code cannot be executed directly? 36. Write down any two causes of syntax errors.
14. Distinguish between source code and object code. 37. What are run-time errors?
15. List out two advantages or characteristic of C 38. Define logical error. Why the logical error is the
language. most difficult error to find?
16. C is a case sensitive language. Justify. 39. Define structured programming OR How program
17. What does it mean by machine independence? logic is implemented in structured programming
18. What is the use of Turbo C++? language?
19. Define IDE. 40. How program logic is implemented in unstructured
20. What is the process of linking in C programs? programming language? Or Define unstructured
21. What is the role of linker in C-language? programming.

LONG QUESTIONS
1. What is a programming language? Discuss the two main categories of programming languages.
2. Define high level language. Write down the characteristics of C language.
3. Describe characteristics of high level programming languages.
4. Define language processor or translator and also explain its types.
5. What necessary steps taken to prepare a C program for execution? Explain with diagram.
6. Write any four steps for writing and executing a C program.
7. Write down step wise procedure for writing a C program.
8. Explain the basic structure of C language program with example.
9. What is bug and debugging? Explain types of errors in C program.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#9
CHOOSE CORRECT OPTIONS
1. Main is a….!
(A)Function (B)keyword (C)Standard Identifier (D) both A and C
2. Variables are created in:
(A)RAM (B)ROM (C)Hard disk (D)Cache
3. Variable and constant names cannot contain a(n):
(A)Number (B)Underscore (C)Letter (D)Period
4. The total number of keywords in C is:
(A)30 (B)32 (C)34 (D)36
5. In C, the maximum length of text name is:
(A)25 characters (B)255 characters (C)155 character (D)55 characters
6. A memory location with some data that can be changed is called:
(A)Constant (B)Variable (C)Named constant (D)None
7. Which of the following is a valid string constant?
(A)“Ab-123” (B)’AB’ (C)6 (D)=
8. Which is a valid character constant?
(A)A (B)“Hello” (C)‘6’ (D)=
9. Find out valid variable name:
(A) Int (B)For (C)5bcd (D)Marks
10. Which of the following data type offers the highest precision?
(A)Float (B)Long int (C)Long double (D)Unsigned long int
11. When the result of the computation of two very small numbers is too small to be represented, this phenomenon is
called:
(A)Arithmetic overflows (B)Arithmetic underflow (C)Truncation (D)Round off
12. How many bytes the float data type takes in memory?
(A)2 (B)3 (C)4 (D)8
13. Which term describes the kind of values that a variable can store?
(A)Variable Name (B)Data type (C)Variable type (D)Variable size
14. The number of bytes used by int data type in C is?
(A)8 (B)6 (C)4 (D)2
15. Number of bytes used by long double data type is:
(A)4 (B)8 (C)10 (D)12
16. The data type in C that can handle fractional values is called:
(A)Long (B)Char (C)Float (D)Int
17. Which is numeric data type with decimal point?
(A)Float (B)Int (C)Char (D)Long
18. Int is a ......... in C.
(A)Special word (B)key word (C)Cut word (D)First word
19. The symbol = represents:
(A)Comparison operator (B)Assignment operator (C)Equal to operator (D)None of these
20. Which of the following operators has lowest precedence?
(A)! (B)+ (C)= (D)==
21. Relational operator is used to:
(A)Establish a relationship among variables (B)Compare two value
(C)Construct compound conditions (D)Perform arithmetic operations
22. The logical not operator denoted by !, is a:
(A)Ternary operator (B)Unary operator (C)Binary operator (D)Bitwise operator
23. a += b is equivalent to:
(A)b += a (B)a =+b (C)a = a+b (D)b = b+a

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

24. The only binary operator in the following is:


(A)? (B)++ (C)-- (D)+
25. Which operators are used to join two or more conditions?
(A)Relational (B)Logical (C)Assignment (D)Comparison
26. Relational operators allow you to ......... values.
(A)Compare (B)Add (C)Multiply (D)Divide
27. When a relational expression is false, it has the value:
(A)Zero (B)One (C)Less than zero (D)Two
28. The type of casting that is done by compiler itself is called:
(A)Implicit casting (B)Explicit (C)Both (D)None
29. The symbols that perform operations on data are called:
(A)Syntax (B)Operand (C)Operators (D)Operation code
30. The symbol “=” represents:
(A)Comparison (B)Assignment (C)Equal to (D)Logical
31. All of the following are logical operators except?
(A)NOT (B)AND (C)OR (D)=
32. The value of the C expression 5/9*2 is:
(A)0.27 (B)1.11 (C)0 (D)2
33. Which of the following is equivalent to (p>=q)?
(A)P<q (B)!(p<q) (C)p>q (D)!p<q
34. Which operator has highest precedence?
(A)! (B)+ (C)/ (D)=
35. This means to increase a value by one:
(A)Modulus (B)Increment (C)Decrement (D)None of these
36. The value of logical operator OR will be 1 if:
(A)A=0 & B=1 (B)A=1 & B=0 (C)A=1 & B=1 (D)All of these
37. Logical operators are:
(A)NOT (B)AND (C)OR (D)All
38. For A = 4 and B =4 which expression evaluates as true?
(A)A>=B (B)A!=B (C)A<B (D)A>B
39. The expression p - = q is equivalent to:
(A)p=q-p (B)p=q-1 (C)p=p-q (D)q=p-q
40. An expression that uses a relational operator is known as:
(A)Operational (B)Sequential (C)Serial (D)Relational
41. An expression consist of:
(A)Operators (B)Operand (C)Both A & B (D)Non

SHORT QUESTIONS

1.Differentiate between keyword and identifier. 14.What is variable initialization? Right its syntax and
2.What is an identifier? example.
3.List two types of identifiers in C. 15.Write down two rules for declaring naming variables in
4.Write the legal characters of an identifier. C.
5.Differentiate between standard identifier and use- 16.Give some examples of valid variable names.
defined identifier. 17.Differentiate between function definition and
6.What do you mean by case sensitive in C language? declaration.
7.Why is C known as strongly typed language? 18.Differentiate between constant and variable.
8.What do you know about C statement? 19.Define standard identifier. Give example
9.What are keywords? 20.Define constant.
10.Define variables. 21.Define character constant. Give example.
11.Why is it important to assign a data type to a variable? 22.Differentiate between string constant and character
12.Why is it important to assign a data type to a variable? constant.
13.Differentiate between declaring and defining a 23.Define data type. Give example.
variable. 24.List any four types of integer data in C language.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

25.Identify the errors in the following lines: 33.What is the use of AND logical operator?
Integer A=2+3; 34.What is the use of || (OR) operators?
Float B=5; 35.What is assignment operator?
Int C=A+b; 36.What is use of assignment operator?
26.What is the value of y after the following code 37.What is increment operator?
execute. Float y=3.4+sqrt(25.0) 38.Differentiate between unary operator and binary
27.Find the errors in the following code. operator.
#include <std10.h> 39.Which operators have been used to evaluate
void main (void) compound condition?
{ 40.What is compound assignment operator? Write its
int x,y,z syntax and example.
z=x+y+z 41.Define compound assignment statement. Write its
} example.
28.Write C statement to print the value of unsigned long 42.Trace the output:
x. int n=6;
29.Find out the errors in the following code. n++;
#include (stdio.h) printf (“%d, n”);
main() 42.Trace the output:
{ int number=6;
char ch=’a’; int x=0;
float 3 digit=33.3; x=--number;
30.Find out the errors form the following code. printf (“%d, x);
void main() 43.Predict the output of the following code:
{ char ch, ch2; int number=6;
ch1=’2’; ++number;
ch2=’6’; Printf (“%d \n”, number);
} 44.Trace the output in the following code.
31.List any four types of operators in C. int x=10 y=15;
32.What is a relational operator?

x=x++;
y=++y;
printf (“%d %d”, x,y);
45.What is meant by operator’s precedence?
46.Find output of the expression 10*(24/(5-2))+13
47.Define operator associativity.
48.Define expression with example.
49.What is arithmetic expression? Give example.
50. Why comments are used in C?
51. Define implicit casting.
52. Define explicit casting.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#10
CHOOSE CORRECT OPTIONS
1.The escape sequence for backslash is:
(A)\ (B)\b (C)\\ (D)\t
2. The format specifier %u is used for:
(A)Integer (B)Unsigned short (C)Unsigned float (D)Unsigned long int
3. In C program, the number of columns that are printed are specified in:
(A)Format specifier (B)Field width specifier (C)Formatting integers (D)Both A & B
4. Escape sequence \\ is used to print:
(A)New line (B)Backslash (C)Space (D)Tab
5. ASCII code for a character is displayed using format specifier:
(A)%d (B)%f (C)%c (D)%x
6. The escape sequence for carriage return is:
(A)\a (B)\c (C)\r (D)\f
7. The function that is used to display output on screen is called:
(A)Printf (B)Scanf (C)Pow (D)Display
8. How many variables can be used in one printf function?
(A)One (B)Two (C)Ten (D)Many
9. Format specifier starts with symbol:
(A)% (B)$ (C)# (D)@
10. Which escape sequence can be used to begin a new line in C?
(A)\ (B)\b (C)\m (D)\n
11. Which of the following is not a valid escape sequence?
(A)\t (B)\\ (C)// (D)\’
12. Which of the following format specifier is used for float data type?
(A)%e (B)%d (C)%f (D)%s
13. Printf() is a:
(A)Keyword (B)Built in function (C)Local function (D)User defined function
15. Which of the following format specifier is used for string?
(A)%f (B)%d (C)%c (D)%s
16. Which of the following things are determined by format specifier?
(A)Data type (B)Field width (C)Format of a value (D)All of these
17. The function used for input and output is stored in:
(A)Stdio.h (B)Conio.h (C)Math.h (D)Tan.h
18. Scanf function is used to input:
(A)Numeric value (B)String value (C)Both A & B (D)None of the above
19. Scanf function stores input value into:
(A)Signature of a variable (B)Constant (C)Position of a variable (D)Address of a variable
20. In statement scanf(“%f,& kilometer); , kilometer is a(n):
(A)Integer variable (B)Float variable (C)String variable (D)Double variable
21. Function which used to get input from the user:
(A)printf() (B)scanf() (C)clrscr() (D)puts()
22. The function getche() is defined in:
(A)stdio.h (B)string.h (C)math.h (D)conio.h
23. what will following statement print: printf(“%c”, 98);
(A)A (B) b (C)B (D)a
24. The function getch() is defined in:
(A)Stdio.h (B)Conio.h (C)String.h (D)Math.h
25. The ASCII code for escape key:
(A)27 (B)28 (C)29 (D)30
SHORT QUESTIONS

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

1. Define standard input. Enlist some important function


for input. 22. What is the output of the following?
2. Define standard output. Enlist some important #include <stdio.h>
function for output. #include <conio.h>
3. Define printf function. Also writes its syntax. void main ()
4. What is format string? Or control string. {
5. What are format specifier? Give example. int i=5;
6. What is the use of %c in C? printf(“%d%d%d”, i, i++, ++i);
7. Define escape sequence. Or which operator is used to getch();
control the output on screen? 23. }
8. What is the use on \n? 24. Show output:
9. What is the use of \r? float x=34.67;
10. What is scanf function? Write down its syntax. printf(“%0,1f”,x);
11. Why ampersand is used in scanf? 25. Show output.
12. What is the use of getch? int i=515;
13. Define getche? printf (“i= %5d”, i);
14. What is the use of clrscr function in C? printf (“i= %2d”, i);
15. Trace the output of the following: 26. Trace the error.
x=5; int b=8;
y=x++; int c=0
printf(“%d %d”, x, y); c=number
16. Write the output of the following code. print f (“%f”, x)
int x=3; 27. Trace the error.
printf(“%d”, x); int b=8;
printf(“%d”, x++); int c=0
printf(“%d”, ++x); c=number
17. Find output: print f (“%f”, x)
A=1, b=0; 28. Find the error in the following code.
a&&b #include (conio.h);
18. Trace output: #include (stdio.h);
void main() void main ()
{ {
int a,b; printf (“OK”);
a=10; }
b=12;
int c=a+b;
printf (“c=%3d”, - - c);
}
19. Find ouput:
int x=10, y=3;
float z=x/y;
printf(“Z=%f”, z);
20. What will be the output of the following?
float t=3.8961
printf (“value of t=%6.2f”, t);
21. Find output:
void main ( )
{
int num=10,
num + = 5;
printf(“\n %d”, num);
}

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#11
CHOOSE CORRECT OPTIONS
1. Which programming structure executes program statements in order?
(A)Relation (B)Decision (C)Sequence (D)Repetition
2. Which programming structure makes a comparison?
(A)Relation (B)Decision (C)Sequence (D)Repetition
3. Another term for a computer making a decision is:
(A)Sequential (B)Selection (C)Repetition (D)Iteration
4. The three programming structure are:
(A)Sequence, decision and repetition (B)Process, decision and alternation
(C)Sequence, definition and process (D)Relation, comparison and process
5. An expression that uses a relational operator is known as:
(A)Operational (B)Sequential (C)Serial (D)Relational
6. ......... refers to group of statements enclosed in opening and closing braces.
(A)Control structure (B)Compound statement (C)Sequence structure (D)Instruction
7. In if statement, true is represented by:
(A)0 (B)1 (C)2 (D)3
8. What is the simplest selection structure?
(A)If (B)Switch (C)If – else (D)Nested – if
9. In if statement, false is represented by:
(A)0 (B)1 (C)2 (D)3
10. Which of the following is used for making two way decisions?
(A)If (B)If – else (C)Nested if (D)Switch
11. Relational operators allow you to ......... numbers.
(A)Compare (B)Add (C)Multiply (D)Divide
12. The operators to compare operands and decide if the relation is true or false are:
(A)Arithmetic operators (B)Logical operators (C)Syntax operators (D)Relational operators
13. When a relational expression is false, it has it value .........
(A)Zero (B)One (C)Less than (D)None
14. Which of the following statement is the simplest form of a decision structure?
(A)Select Case (B)If statement (C)Try Catch Finally (D)Nested if
15. ……….is used to specify two different choices with “if” statement.
(A)Switch statement (B)Else statement (C)If statement (D)If else
16. Which of the following is not part of an if statement?
(A)A condition that evaluates as a Boolean (B)A condition that evaluates as true or false
(C)A true block (D)All of are part of an IF statement
17. An if statement inside the true block of another if statement is called:
(A)A nested if statement (B)A branched if statement (C)A conditional operator (D)A relational operator
18. If x=10 and y=5, what will the output of the following expression? x!=y?
(A)True (B)False (C)Both (D)None
19. Which keyword is not used in switch statement?
(A)Default (B)If (C)Case (D)Switch
20. Switch statement is an alternative of:
(A)If (B)If – else (C)Nested – if (D)Nested – if – else
21. The last statement of each case block in switch () structure must be:
(A)Default (B)If – else (C)Break (D)Else
22. The case block in switch () structure ends with:
(A)End select (B)Break (C)End case (D)Case else
23. Which of the following is called counter loop?
(A)Nested if – else (B)If – else (C)For loop (D)While loop
24. Which is an example of multiple branches from single expression?
(A)If statement (B)Switch statement (C)While loop (D)All
25. Which of the following are valid case statements in a switch?
(A)Case 1 (B)Case x<4 (C)Case ‘ab’ (D)Case1.5
26. A case can be defined as:
(A)An individual condition to test (B)A set of condition to test
(C)A statement that includes an IF statement (D)A block of selection code

27. The Case block ends with:

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

(A)End Select (B)End Case (C)Break (D)Case Else


28. The conditional operator is used as alternative to:
(A)If (B)If – else (C)If – else if – else (D)Switch
29. Another term for a conditional operator is:
(A)Ternary (B)Binary (C)Byte (D)Iteration
30. Conditional operator takes:
(A)One operand (B)Two operands (C)Three operators (D)Four operands
31. Which operator is called a ternary operator?
(A)If (B)++ (C)? (D)()
32. Which of the following is equivalent to (p>=q)?
(A)p>q (B)(p<q) (C)P>q (D)!p<q

SHORT QUESTIONS

1. Define control structure. Enlist different q=2; 18. Find output:


control structure. if(p%q==3) int p=3, q=5;
2. How statements are executed in r=0; if ((p>q) || (q!=4))
selection structure? else p=p+1;
3. How statements are executed in r=1; else
repetition structure? printf (“%d”, r) p=p*2;
4. What are the limitation of if statements? printf (“p=%d”, p);
5. What is if else statement? Write down 15. Find output: 19. Find output:
its syntax and flow chart. int x=1; int x=5, y=10;
6. What is if else if? int y=z=3; if (x>y)
7. Write down the syntax of if else if. if( (x==y) || (y==z) || (z==z)) y=2;
8. What is nested if? printf(“yes”); 20. Trace errors:
9. Why default label is written in switch? else #include (Stdio.n);
10. What happens if break statement is not printf(“no”) #include <conio.c>
written in switch? 16. Trace output: void main ()
11. What are condition/ternary operator? if gdare = “B”? {
Write down its syntax. if (grade == ‘A’ || grade == ‘B’ && If (16>10) then
12. Write down the difference b/w nested if grade == ‘C’) printf (“%C”, “Pakistan”);
else and switch. printf (“Fail”); getch();
13. Trace the output of the following: else
}
If (1==2) printf (“Pass”);
printf (“Progrmming”); }
21. Show output.
else if (2==1) 17. Show output.
printf (“Language”); int p=10;
int ch=’x’;
else if (p!=10) Switch(ch)
printf (“Correct ir”); p=0; { case ‘x’:
14. Write the output of the following code. else Pritnf(“YES\n”);
int p, q, r; p=5; Case ‘y’:
p=10; Printf(“NO”; );
LONG QUESTIONS

1.What is a control structure? Briefly describe the basic control structures for writing programs.
2.Write a program that input a number from user and finds it is positive, negative or zero.
3.Write a program in C that inputs the number of the month of the year and display the number of days of the corresponding
month using if-else-if statement. (e.g. if user enters 2, it will display 28 or 29)
4.Write a program in C that inputs a number by the user and checks whether it is even or odd.
5.Write a program which input three numbers, and display largest number using if else if.
6.Write a program in C-Language that inputs two numbers and one arithmetic operate (+,-,*) it applies arithmetic operation
on numbers on the basis of given operator.
7.Write a program that inputs a character from user and checks whether it is a vowel or not using switch.
8.What is if-else-if statement? Write down its syntax, flow chart and working with example.
9.What is nested if statement? Write down its syntax flow chart and working with example.
10.What is switch statement? Write down its syntax flow chart and working with example

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#12
CHOOSE CORRECT OPTIONS
1. How many types of loop structures are present?
(A)1 (B)2 (C)3 (D)4
2. One execution of a loop is known as a (n):
(A)Test (B)Iteration (C)Duration (D)Integer
3. A loop that never ends is called:
(A)Infinite loop (B)Running loop (C)Nested loop (D)Continuous loop
4. One iteration of loop is known as:
(A)Iteration (B)Duration (C)Cycle (D)Repetition
5. In while loop, the loop control variable is always initialized:
(A)Outside the program (B)Inside the loop body (C)After loop ends (D)Outside the body of loop
6. While loop is also called:
(A)Conditional loop (B)Wend loop (C)Counter loop (D)None
7. ......... loop structure always executes at least once?
(A)Nested (B)FOR (C)While (D)Do While
8. In which loop the condition comes after the body of the loop?
(A)For () (B)While () (C)Do-while () (D)Nested for ()
9. Which of the following loop is available in C language?
(A)While-wend (B)For-next (C)Sequence (D)Do-while
10. Semicolon is placed at the end of condition in:
(A)Switch (B)For loop (C)While loop (D)Do-while loop
11. The Do-while loop structure always ends with:
(A)Comma (B)Semi colon (C)Colon (D)Brace
12. ......... iterates at least once if condition is false.
(A)While loop (B)Do-while loop (C)For loop (D)All of these
13. In for statement, the expression is executed only once:
(A)Validation (B)Initialization (C)Test (D)Condition
14. What is the final value of x after executing the following code for (int x=0; x<,10; x++)?
(A)8 (B)9 (C)10 (D)11
15. If you want a user to enter exactly 20 values which loop would be the best to use?
(A)While (B)Do-while (C)Infinite (D)FOR
16. Which one is the loop structure?
(A)If (B)If-else (C)Switch (D)For
17. What is the final value of I after executing the following code for (int i=1; i<5; i+=2)?
(A)3 (B)5 (C)6 (D)9
18. A loop within a loop is called:
(A)Complex (B)Nested (C)Infinite (D)For
19. In which kind of loop the programmer know the repetition in advance:
(A)while (B)do while (C)Switch (D)For
20. A loop which depend on sentinel value:
(A)while (B)Nested (C)Infinite (D)For

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

SHORT QUESTIONS

1. Define loop. Enlist different loop. 14. Trace the output of the following: i=3;
2. What are the benefits of using loop. Void main () do
3. What kind of loop executes a { {
statement of set of statement int x, y=5; printf (“%d\n”, i);
repeatedly as long as condition for (x=0; x<3; x++) i+=3;
remains true. if (y>=5) }
4. What is control variable? printf (“%d\t”, x); while (i<=21);
5. What is while loop? Write down its }
syntax. 15. Convert the following do-while loop
6. What is do while loop. Also writes its in for loop. 18. Find output:
syntax. int c=2; int x=10;
7. Define for loop. Write its synax. do while (x>=1)
8. What is nested loop. printf (“%C”, c); {
9. Write down the syntax of nested while (c++ <=5); printf (“%d”, x %2);
loop. 16. Find output: x--;
10. Which statement is used in place of #include <stdio.h> }
loop? Or Define goto statement. void main 19. Find output:
11. What is counter controlled loop. { int x=5, y=3;
Give example. int i, p=1; do
12. What is sentinel value? for (i=1; i<6; i+=1) {
13. What are sentinel controlled loop. p*2; x=x*2;
Give example. printf (“p is = %d”, p); y=y+2;
} }
17. Convert following loop code into for while (y<7);
loop code. printf(“%d”,x);

LONG QUESTIONS

1.What is while loop? Write its syntax, explain its working with flowchart and example.
2. What is do-while loop? Write its syntax, explain its working with flowchart and example.
3. What is for loop? Write its syntax, explain its working with flowchart and example.
4. What is nested loop? Write its syntax, explain its working with flowchart and example.
5.Write a program which input a display its table using for loop.
6.Write a that input a number and display its factorial using for/while loop.
7.Write a program that display first 5 number and their sum.
8.Write a program using while loop that display first 20 odd numbers.
9.Write a program that display even number b/w 1 to 30.
10.Write a program that input a number and display whether it is prime or not.

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#13
CHOOSE CORRECT OPTIONS
1. Printf() is a:
(A)Built-in function (B)User-defined function (C)Local function (D)Keyword
2. A built-in function:
(A)Cannot be redefined (B)Can be redefined( C)Cannot return a value (D)Should be redefined
3. Another name for built-in function is:
(A)Library function (B)User-defined function (C)Arithmetic function (D)All of these
4. A type of function written by the programmer is known as:
(A)User-defined (B)Sub programs (C)Sub routines (D)Built-in function
5. The first line of user-defined function is:
(A)Arguments (B)Header (C)Prototype (D)Calling
6. Function prototypes for built-in functions are specified in:
(A)Source files (B)Header files (C)Object files (D)Image files
7. In a C program, two functions can have:
(A)Same name (B)Same parameters
(C)Same name and same parameter (D)Same name but different parameters
8. Multiple arguments to a function are separated by:
(A)Period (B)Colon (C)Commas (D)Semicolon
9. In C-Language, the first line of function definition is known as:
(A)Function header (B)Function body (C)Arguments (D)Parameters
10. A function that does not return any thing has return type:
(A)Nothing (B)Float (C)Void (D)Null
11. Which statement is used by a function to return a value?
(A)Give (B)Send (C)Return (D)Call
12. Function declaration is also known as function .........
(A)Definition (B)Header (C)Prototype (D)Parameters
13. Which of the following looks for the prototypes of functions used in a program?
(A)Linker (B)Loader (C)Compiler (D)Parser
14. Which of the following is true about a function call?
(A)Stops the execution of the program (B)Transfers control to the called function
(C)Transfers control to the main function (D)Resumes the execution of the program
15. Memory is allocated to a local variable at the time of its:
(A)Declaration (B)Destruction (C)Definition (D)First reference
16. Local variable are also called:
(A)Automatic variable (B)Static variable (C)Register variable (D)Run time variable
17. The scope of a variable refers to its:
(A)Length (B)Name (C)Accessibility (D)Data type
18. Memory allocated to a local variable at the time of its:
(A)Declaration (B)Destruction (C)Execution (D)First reference
19. Global variables are created in:
(A)RAM (B)ROM (C)Hard Disk (D)Cache
20. A function can return ......... value.
(A)1 (B)2 (C)3 (D)4
21. The name of actual and formed parameters:
(A)May or may not be same (B)Must be same (C)Must be different (D)Must be in lowercase
22. Formal arguments are also called:
(A)Actual arguments (B)Dummy arguments (C)Original arguments (D)Referenced arguments
22. which kind of variables can be accessed outside of any function:
(A)Local (B)Global (C) Both (D)None

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


PREPARED BY: SIR WAKEEL AHMAD KIPS COLLEGE SHEIKHUPURA
CONTACT: 03463780191 EDUCATION SCIENCE ACADEMY
____________________________________________________________________________________________

CHAP#14
CHOOSE CORRECT OPTIONS
1. A file is stored in:
(A)RAM (B)Hard Disk (C)ROM (D)Cache
2. The character conversion may occur in:
(A)Text stream (B)Binary stream (C)Input stream (D)Output stream
3. A sequence of characters from an input device to computer is called:
(A)Input stream (B)Text stream (C)Binary stream (D)Output stream
4. Which of the following mode open only an existing file for both reading and writing:
(A)“w” (B)“w+” (C)“r+” (D)“a+”
5. fopen() function takes ......... parameters.
(A)1 (B)2 (C)3 (D)4
6. On successfully closing a file, the fclose() returns:
(A)NULL (B)0(zero) (C)1(one) (D)FILE pointer
7. What is a new line marker in C:
(A)\n (B)Enter (C)\r (D)File pointer
8. Which mode opens only an existing file for both read and append?
(A)“w” (B)“w+” (C)“r+” (D)“a+”
9. Which of the following functions is used to read character from a file?
(A)getc() (B)putc() (C)fputs() (D)fgets()
10. Which of the following function is used to read a string to a file?
(A)getc() (B)putc() (C)fputs() (D)fgets()
11. An array subscript should be:
(A)Int (B)Float (C)double (D)An array
12. Which of the following character is used to mark the end of the string?
(A)\0 (B)/0 (C)\a (D)\n
13. Which of the following functions is used to write a string to a file?
(A)Puts() (B)Pute() (C)Fputs() (D)Fgets()

CHAP 13 SHORT QUESTIONS


CHAP 14 SHORT QUESTIONS
1. Define the term function.
1. Describe the purpose of file handling. 2. Write three advantages of functions.
2. Define a stream. 3. Define built-in function.
3. Write the name of two types of stream used in files in C 4. Describe user-defined function.
5. How many maximum values can a function return using
Language.
return statement?
4. What do you mean by text steam? 6. What is function header?
5. What is library stream? 7. Define function declaration with its syntax.
6. Compare binary and text stream. 8. What is function definition?
7. Define EOF marker in file. 9. Define function header also write its syntax.
8. What is a text file? 10. Define function body.
9. Define a pointer. 11. What is meant by a function call?
10. Explain different types of modes, r, w, r+, w+, a, a+. 12. What is the purpose of a function argument?
11. Why is it important to close a file? 13. Differentiate b/w actual and formal parameters.
12. How is a file closed? 14. What is the return statement?
15. Define local variable or what kind of variable can be
13. What is file pointer?
accessed only a block in which they are declared?
16. What is meant by scope of variable?
17. How long local variable resides in memory? Or What is the
lifetime of local variable?
18. What are global variable? Or what kind of variable can be
accessed everywhere in a program?
19. What is the scope of global variable?
20. How long the global variable exists in the memory?

Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191


Prepared By:Wakeel Ahmad:(BSCS) Contact:0346-3780191

You might also like