0% found this document useful (0 votes)
13 views19 pages

Computer 1 New

The document provides a comprehensive overview of data and database concepts, including definitions of data, information, data processing, and types of files and database management systems. It also covers key database design principles, normalization, and the use of Microsoft Access as a DBMS. Additionally, it discusses various database constraints, anomalies, and the roles of database administrators and end users.

Uploaded by

squub99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views19 pages

Computer 1 New

The document provides a comprehensive overview of data and database concepts, including definitions of data, information, data processing, and types of files and database management systems. It also covers key database design principles, normalization, and the use of Microsoft Access as a DBMS. Additionally, it discusses various database constraints, anomalies, and the roles of database administrators and end users.

Uploaded by

squub99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Chapter 1

Q 1. What is data?
Ans. Data is raw facts and figures, such as numbers or names. It has no meaning until processed by a computer.

Q 2. What is information?
Ans. Information is processed data that is meaningful and useful. It helps in decision-making and understanding
results.

Q 3. What is the difference between data and information?


Ans. Data is unprocessed input, while information is the processed output. Data becomes information after
processing.

Q 4. Define data processing.


Ans. Data processing is the conversion of data into useful information. It involves sorting, calculating, and
organizing data.

Q 5. What is data manipulation?


Ans. Data manipulation means changing or organizing data. It includes sorting, classifying, and summarizing data.

Q 6. Define field?
Ans. A field is a column in a database table that stores one type of data. It represents an attribute of an entity.

Q 7. Define record.
Ans. A record is a set of related fields about one item or person. For example, a student record has name, roll no,
and marks.

Q 8. Define file.
Ans. A file is a collection of related records treated as a single unit. For example, a student file contains all the
records of students.

Q 9. Name the file types from usage point of view.


Ans. The types of files from a usage point of view are:
• Master file
• Transaction file
• Back up file

Q 10. Name the file types from function point of view.


Ans. The types of files from a function point of view are:
• Program files
• Data files

Q 11. What is a program file?


Ans. A program file contains software instructions. Examples include source files and executable files.

Q 12. What do you mean by file organization?


Ans. File organization refers to the physical arrangement of records in a file on secondary storage devices. Different
methods are used, each with its advantages and disadvantages.

Q 13. Name different types of file organization.


Ans. Different types of file organization are:
• Sequential files
• Direct or random access files
• Indexed sequential files

Q 14. What are sequential files?


Ans. Sequential files store data one after another in a sequence. They are portable but take more time to store data
and only allow sequential access.

Q 15. What are direct or random access files?


Ans. In random access files, records are accessed directly without going through the preceding ones. Data is stored
at a specific address, saving processing time.

Q 16. What are indexed sequential files?


Ans. Indexed sequential files allow both sequential and random access based on a key value. They require more disk
space but offer fast processing similar to random files.

Q 17. What is an index?


Ans. An index is a data structure used to speed up operations on a database table. It improves quick lookups and
efficient access to ordered records using one or more columns of the table.

Q 18. Define database?


Ans. A database is a structured collection of data stored on a computer. It allows programs to query the data, which
can then be used to make decisions. The software used to manage the database is called a DBMS.

Q 19. What is database management system?


Ans. A DBMS is a collection of programs that enables storing, modifying, and retrieving data from a database. It is
used by organizations to manage various types of files and databases.

Q 20. What is data dictionary?


Ans. A data dictionary is a file in a DBMS that stores the definitions of the database structure, such as the name,
type, range of values, and access authorization for each data element.

Q 21. What do you mean by consistency constraint?


Ans. Consistency constraints are rules that ensure data entered into a database is valid, such as ensuring no
numerical values are entered in a name field or dates are correctly formatted in a date of birth field.

Q 22. What is meant by data independence?


Ans. Data independence means that data is separate from application programs. The physical implementation of data
is hidden from the programs, with a DBMS acting as an intermediary between them.

Q 23. Name some large databases developed.


Ans. Some large databases include NADRA, Google, VISA, and Amazon books database, which are widely known
across the world.

Q 24. Write down any two disadvantages of database system.


Ans. Disadvantages of database systems include:
• Additional training is required for users and administrators.
• There are extra costs for hardware and software to support the system.

Q 25. What are the activities performed on data?


Ans. Activities performed on data in a database include:
• Adding new files or data.
• Removing or deleting data.
• Inserting, retrieving, and updating data in existing files.
Q 26. Name the four major components of a database system.
Ans. The four major components of a database system are:
• Data: Raw facts that are processed into information.
• Hardware: Physical components, including storage and input/output devices.
• Software: Programs such as system and user software, including utilities.
• Personnel: People involved, such as programmers, analysts, end-users, and database administrators.

Chapter 2

Q 1. Define relation.
Ans. In a relational database, a relation is a table where data is stored. It consists of rows and columns, with each
intersection called a cell. Tables represent descriptive information about an entity.

Q 2. What is an Entity?
Ans. An entity is anything about which data is stored, such as a person, place, or event. It always has a unique name
within a domain.

Q 3. What is the use of views?


Ans. Views are virtual tables used to protect data from unauthorized access. They are dynamic and computed from
the data in a database, reflecting changes in the base tables.

Q 4. What is a key?
Ans. A key field is a unique identifier for a database record, created from one or more fields in a table. Keys are also
used for defining search criteria.

Q 5. Define primary key.


Ans. A primary key is an attribute or combination of attributes that uniquely identifies each record in a relation, such
as a student roll number or social security number.

Q 6. Define secondary key.


Ans. A secondary key is a non-unique field used as an alternate key to access records, other than the primary key.

Q 7. Define candidate key.


Ans. Candidate keys are potential keys that could be selected as the primary key. While a relation can only have one
primary key, multiple candidate keys can exist.

Q 8. Define composite key.


Ans. A composite key is formed by combining two or more fields to create a unique identifier for a record, used
when no single field is sufficient for uniqueness.

Q 9. Define sort key.


Ans. A sort key is a field or set of fields that dictate the order of records in a file, such as sorting by name within a
state.

Q 10. What is the use of index file?


Ans. Index files are used by DBMS to speed up sorting and searching operations by providing a structured way to
access data more quickly.

Q 11. Who is an end user?


Ans. An end user is a person who uses a DBMS for their needs, typically requiring some IT knowledge but not
needing to understand the technical details of the system.
Q 12. Who is a data administrator?
Ans. A Data Administrator (DA) is responsible for defining, organizing, and protecting data to ensure its quality,
accessibility, and shareability across an organization.

Q 13. Who is a database administrator?


Ans. A database administrator (DBA) manages the operational aspects of a database, such as backup, data integrity,
security, performance, and supporting development and testing.

Q 14. List two properties of a relation.


Ans. Properties of a relation include:
• Unique column names
• The order of rows and columns is insignificant.

Q 15. Discuss the data manipulation in DBMS system?


Ans. In DBMS, data is stored in tables (relations), which may relate to each other using primary and foreign keys.
DBMS uses SQL for data manipulation, providing efficient access through indexes.

Chapter 3

Q 1. Define analysis.
Ans. Analysis is the process of studying the existing system and determining what should be included in the new
system. It is crucial for developing a database system, and the person responsible for this is called an "Analyst."

Q 2. What is the importance of project planning?


Ans. Project planning defines the scope, methods, and resources required for completing a project. It involves
estimating the duration of tasks, allocating resources, and calculating the total project cost.

Q 3. What is data modelling?


Ans. Data modelling involves identifying data objects and their relationships. It starts with a conceptual model and
progresses to a logical model and physical schema, which is crucial for database design.

Q 4. Define cardinality.
Ans. Cardinality refers to the number of occurrences of one entity associated with occurrences of another entity,
such as a country having many cities but only one capital.

Q 5. Define Modality.
Ans. Modality defines whether an entity's participation in a relationship is mandatory or optional. A cardinality of
zero means an optional relationship, while at least one means a mandatory relationship.

Q 6. What is an E-R diagram?


Ans. An Entity-Relationship (E-R) diagram is a graphic representation illustrating the relationships between entities
in a database. It uses symbols to convey three types of information.

Q 7. What is logical database design?


Ans. Logical database design is the process of mapping the conceptual model to the target DBMS structures, such as
normalized relations in relational databases.

Q 8. What is physical database design?


Ans. Physical database design involves creating the actual storage structure of records, files, indexes, and other data
structures to ensure performance, data integrity, security, and recoverability.
Q 9. What is meant by centralized database distribution?
Ans. In centralized database distribution, all data is stored in a single location, which makes management easy but
can have disadvantages like high data communication costs and lack of accessibility for remote users.

Q 10. What is partitioned database distribution?


Ans. In partitioned database distribution, data is divided into fragments and distributed across different computers,
making it more accessible than a centralized database.

Q 11. What is replicated database distribution?


Ans. Replicated database distribution involves storing a full copy of the database on multiple computers. Changes
made to the parent are replicated, but it requires more storage, incurs communication costs, and needs frequent
synchronization.

Chapter 4

Q 1. What is meant by entity integrity?


Ans. Entity integrity is a constraint stating that every table must have a primary key, and the primary key's
column(s) must be unique and not null, ensuring no duplicate rows.

Q 2. What is referential integrity?


Ans. Referential integrity is a constraint on foreign keys, stating that the foreign key must either match the primary
key of another tuple or be completely NULL.

Q 3. What is redundancy?
Ans. Redundancy occurs when the same data is stored more than once in a table or across multiple tables.

Q 4. What is normalization?
Ans. Normalization is the process of converting complex data structures into simpler, stable ones by analyzing
attribute dependencies to ensure data is stored correctly.

Q 5. What is repeating group?


Ans. A repeating group is a set of one or more data items that may occur multiple times in a tuple.

Q 6. What are database anomalies?


Ans. Database anomalies are inconsistencies that occur when records are deleted, modified, or inserted, causing the
database to be in an inconsistent state.

Q 7. What is insertion anomaly?


Ans. Insertion anomaly occurs when a new record can't be inserted unless additional facts about another entity are
also inserted.

Q 8. What is deletion anomaly?


Ans. Deletion anomaly occurs when deleting a record causes the loss of facts about another entity.

Q 9. What is modification anomaly?


Ans. Modification anomaly occurs when updating a value requires changing all records containing that value.

Q 10. What is partial dependency?


Ans. Partial dependency is when non-key attributes depend on only part of the primary key.
Q 11. What is transitive dependency?
Ans. Transitive dependency exists when a non-key attribute depends on another non-key attribute, rather than
directly on the primary key.

Q 12. What is integrity constraint?


Ans. Integrity constraints are rules that ensure the correctness and consistency of data in a database, maintaining
data quality and preventing violations.

Q 13. What is 1st Normal form?


Ans. A relation is in 1st normal form if all domain values are atomic (contain only one value per cell) and there are
no repeating groups.

Q 14. What is 2nd Normal form?


Ans. A relation is in 2nd normal form if it is in 1st normal form and every non-key attribute is fully functionally
dependent on the primary key.

Q 15. What is 3rd Normal form?


Ans. A relation is in 3rd normal form if it is in 2nd normal form and has no transitive dependencies between non-
key attributes.

Chapter 5

Q 1. What is Microsoft Access?


Ans. Microsoft Access is a popular and powerful DBMS that allows users to create and maintain databases,
including tables, forms, queries, and reports.

Q 2. What is a wizard?
Ans. A wizard is a helper application that simplifies complex tasks by guiding users through a series of steps with
back and next buttons.

Q 3. What is a menu bar?


Ans. The menu bar, located just below the top of the window, contains various menus, each with a shortcut key
represented by an underlined character.

Q 4. What is a database object?


Ans. A database object is a component of a database system used to manage and organize data.

Q 5. What is a table?
Ans. A table is a collection of rows and columns, where each column represents a field that stores a specific type of
data. Data is stored in cells at the intersections of rows and columns.

Q 6. What is a query?
Ans. A query is a database object used to retrieve, update, or delete data from a database based on specific criteria.

Q 7. What is a form?
Ans. A form is a window in Microsoft Access used to enter, edit, or view data, with fields linked directly to the
corresponding table fields.

Q 8. What are reports?


Ans. Reports are database objects used to present queried data in a formatted, presentable way, which can be
generated from tables and queries.
Q 9. What is an IDE?
Ans. An IDE (Integrated Development Environment) is a user-friendly interface that provides graphical tools
(buttons, icons, menus) to simplify tasks for both new users and programmers, and MS Access provides this feature.

Chapter 6

Q 1. What is a table?
Ans. A table is a collection of rows and columns, with each intersection (row and column) called a cell where data is
stored. It is the fundamental object in a relational database and represents an entity.

Q 2. What is meant by the degree of relation?


Ans. The degree of a relation refers to the number of fields (columns) in a table. It can be changed at any time, but
doing so may cause data loss.

Q 3. What is meant by the cardinality of the relation?


Ans. The cardinality of a table is the number of records (rows) in it. It changes as records are added or deleted.

Q 4. What are the two table views available in Microsoft Access?


Ans. Design view and Datasheet view.

Q 5. What is the Text data type?


Ans. The Text data type is the default field type in MS Access, allowing storage of text or combinations of text and
numbers, such as phone numbers. Its size is 255 characters or the length set by the FieldSize property.

Q 6. What is Memo data type?


Ans. The Memo data type is used to store large amounts of text, up to 64,000 characters, and is typically used for
long descriptions.

Q 7. What is Number data type?


Ans. The Number data type stores numeric data for calculations. It can have sizes of 1, 2, 4, or 8 bytes, depending
on the required precision.

Q 8. What is AutoNumber data type?


Ans. The AutoNumber data type assigns a unique sequential or random number to each new record, which cannot be
updated. It has a size of 4 bytes.

Q 9. What is the use of Default value?


Ans. The Default value property allows setting a default value for a field, so users don't need to repeatedly enter the
same value for all records in that field.

Q 10. What is sorting?


Ans. Sorting is the arrangement of data in a particular sequence, either ascending or descending.

Q 11. What is referential integrity?


Ans. Referential integrity is a system of rules that ensures relationships between records in related tables remain
valid, preventing accidental deletion or modification of related data.

Q 12. What is a query?


Ans. A query is a question that retrieves data from a database by specifying which fields to display and conditions
for extracting records.

Q 13. What is a join?


Ans. A join is a query that combines data from multiple tables based on their relationships.
Q 14. What are wildcards?
Ans. Wildcards are special symbols used in queries to search for data. Common wildcards include *, ?, and #, often
used with text fields or dates.

Q 15. Define criteria in a query?


Ans. Criteria in a query is a condition used to limit the rows extracted from the database. For example, specifying
criteria to view only suppliers from China.

Chapter 7

Q 1. What is a form?
Ans. A form is a window with visual components (controls) like text boxes, labels, and checkboxes used to input
and display data in a database.

Q 2. Write a few uses of Form?


Ans. Forms are used to add, delete, view, search data, and accept user input for specific actions in a database.

Q 3. What is a sub form?


Ans. A sub form is a form placed inside a main (parent) form, used to display data from a related table, especially in
one-to-many relationships.

Q 4. What is conditional formatting?


Ans. Conditional formatting is special formatting applied to controls like text boxes based on their values.

Q 5. What is a report?
Ans. A report is an output document generated from a database to present data in a structured and readable format.

Q 6. What is linking?
Ans. Linking creates a connection to a table in another database without copying it, allowing access to external data.

Q 7. What is a switch board?


Ans. A switchboard is a form that acts as a custom menu for navigating and performing actions within a database
using buttons or hyperlinks.

Q 8. What is keyboard shortcuts?


Ans. Keyboard shortcuts are key combinations that perform tasks quickly and efficiently.

Q 9. What is input mask?


Ans. An input mask sets a specific format for data entry in fields, such as dates in the dd/mm/yy format.

Q 10. Define tabular form briefly?


Ans. A tabular form displays multiple records with fields as columns and records as rows, allowing simultaneous
viewing of several records.

Q 11. Define columnar form?


Ans. A columnar form displays one record at a time with fields and labels side by side, including a navigation bar
for moving through records.

Q 12. Define Datasheet form?


Ans. A datasheet form shows data in a datasheet view with each row as a record, often used for sub forms and
includes navigation.
Q 13. What is a list box?
Ans. A list box is a control that displays multiple values, allowing the user to select one or more values.

Q 14. What is a combo box?


Ans. A combo box displays multiple values but allows only one to be selected at a time.

Q 15. What is a switch board?


Ans. A switchboard is a form with buttons linked to database objects to open, close, or modify them.

Chapter 8

Q1. What is computer program?


Ans. A computer program is a set of instructions given to the computer to solve a specific problem. Programs are
written in programming languages.

Q2. What is programming language?


Ans. A programming language is used to communicate with the computer. It has a set of alphabets and rules used to
write instructions.

Q3. List different types of programming language.


Ans.

1. Low level languages


2. High level languages

Q4. What is high level language?


Ans. A high level language is closer to human language and easier to learn and understand.

Q5. What is low level language?


Ans. A low level language is close to computer language. It includes:

1. Machine language
2. Assembly language

Q6. What is machine language?


Ans. It is the native language of the computer using binary digits (0 and 1).

Q7. What is assembly language?


Ans. A language where machine language instructions are replaced by mnemonics (English-like words).

Q8. What is source program?


Ans. A program written in high level language.

Q9. What is object program?


Ans. A program in machine language generated from the source program.

Q10. What is language translator?


Ans. Software that converts a program into machine language.

Q11. What is compiler?


Ans. A software that converts the entire high level program into machine code and checks for errors.
Q12. What is interpreter?
Ans. A software that converts and executes one statement at a time from the source code.

Q13. What is assembler?


Ans. A translator that converts assembly language into machine language.

Q14. What is structured programming language?


Ans. A language in which a program is divided into modules for easier writing and debugging.

Q15. What is unstructured programming language?


Ans. A language in which the program is a single unit, making it hard to debug.

Q16. What is preprocessor?


Ans. A program that modifies C program before compilation.

Q17. What is preprocessor directive?


Ans. Instructions for the preprocessor, starting with #.

Q18. What is the work of include directive?


Ans. It includes header files in the program.

Q19. What is the work of define directive?


Ans. It defines a constant macro using the #define directive.

Q20. What is statement terminator?


Ans. A semicolon (;) used to end each C statement.

Q21. What are delimiters?


Ans. Curly braces { } used at the beginning and end of main function.

Q22. What is main function?


Ans. The entry point of a C program where all instructions are written inside { }.

Q23. What are bugs and debugging?


Ans. Bugs are errors in a program; debugging is the process of finding and removing them.

Q24. What is meant by creating a program?


Ans. Writing source code in an editor like Turbo C IDE.

Q25. What is meant by editing a program?


Ans. Modifying source code and removing errors.

Q26. What is meant by compiling a program?


Ans. Converting source code into object code using a compiler.

Q27. What is meant by linking a program?


Ans. Combining object code with required library functions to make an executable file.

Q28. What is meant by executing a program?


Ans. Running the executable file using a program loader or Turbo C IDE.
Q29. List name of some high level language.
Ans. C, C++, C#, COBOL, BASIC, FORTRAN, PASCAL, JAVA

Q30. What is Turbo C++?


Ans. An IDE developed by Borland to write, compile, debug, and run C/C++ programs.

Q31. What are necessary step to prepare a C program?


Ans.

 Creating & Editing


 Saving
 Compiling
 Linking
 Loading
 Running

Q32. What are header files?


Ans. Files that contain definitions of library functions grouped by functionality.

Q33. What is C statement?


Ans. An instruction written in C ending with a semicolon.

Q34. What are syntax errors?


Ans. Errors due to incorrect syntax in the code, detected by compiler.

Q35. What are logical errors?


Ans. Errors due to wrong logic or algorithm, not detected by compiler.

Q36. What are runtime errors?


Ans. Errors that occur during program execution, causing the program to stop.

Q37. What is ANSI C?


Ans. The standard version of C language created by ANSI in the 1980s.

Q38. List any four advantages of C language?


Ans.

 Easy to learn
 Easy to remove errors
 Machine independence
 Standard syntax
 Shorter programs

Q39. What is meant by machine independence?


Ans. High level language programs can run on any type of computer.

Q40. What is the difference between compiler and interpreter?


Ans.

 Compiler: Translates entire program at once into machine language.


 Interpreter: Translates and executes one statement at a time.
Chapter 9

Q1. What is an identifier?


(Answer) Names used for variables, constants, functions, etc., in a program.

Q2. What is user defined identifier?


(Answer) Names assigned by the programmer to variables, functions, etc.

Q3. What is standard identifier?


(Answer) Identifiers like printf, scanf that have predefined meanings in C.

Q4. What is a keyword?


(Answer) Reserved words in C with predefined meanings, e.g., int, return.

Q5. What is a variable?


(Answer) Named memory location used to store data during program execution.

Q6. What is a constant?


(Answer) A value that does not change during program execution.

Q7. What is meant by variable declaration?


(Answer) Specifying a variable's name and its data type.

Q8. What is variable initialization?


(Answer) Assigning an initial value to a variable at the time of declaration.

Q9. What is meant by typed language?


(Answer) A language where variables must be declared with a data type before use.

Q10. What are different types of constants?


(Answer) Numeric constants and character constants.

Q11. What is meant by data type?


(Answer) It defines the set of values and operations for data and its memory size.

Q12. What is meant by standard data type?


(Answer) Built-in types like int, char defined by the C language.

Q13. What is meant by user defined data type?


(Answer) Data types created by the programmer using structures or typedef.

Q14. Which data types can be used to store integer data?


(Answer) int, short int, long int, unsigned int, unsigned long int.

Q15. Which data types can be used to store floating-point data?


(Answer) float, double, long double.

Q16. What is cancellation error?


(Answer) Loss of small value when added to a large floating-point number.

Q17. What is meant by underflow?


(Answer) Error when value stored is less than minimum allowed range.
Q18. What is meant by overflow?
(Answer) Error when value stored is more than maximum allowed range.

Q19. What is character data type?


(Answer) char type used to store single characters using ASCII values.

Q20. How are characters stored?


(Answer) Stored as ASCII values in memory.

Q21. What is an operator?


(Answer) A symbol used to perform operations on data.

Q22. What are different types of operators?


(Answer) Arithmetic, relational, logical, increment/decrement, assignment.

Q23. What is an arithmetic operator?


(Answer) Operators like +, -, *, / used for arithmetic operations.

Q24. What is an assignment operator?


(Answer) = symbol used to assign a value to a variable.

Q25. What is an assignment statement?


(Answer) A statement that assigns a value to a variable using =.

Q26. What is compound assignment?


(Answer) Assigning the same value to multiple variables, e.g., A = B = 10;.

Q27. What is compound assignment operator?


(Answer) Combines arithmetic and assignment, e.g., +=, -=, *=, /=.

Q28. What is increment operator?


(Answer) ++ operator that adds 1 to a variable.

Q29. What is decrement operator?


(Answer) -- operator that subtracts 1 from a variable.

Q30. What is relational expression?


(Answer) Combination of operands and relational operators that gives true/false.

Q31. What are logical operators?


(Answer) Operators like AND (&&), OR (||), NOT (!) for logic operations.

Q32. What is logical expression?


(Answer) Combination of logical operators and relational expressions.

Q33. What is AND operator?


(Answer) Returns true if both expressions are true; symbol &&.

Q34. What is OR operator?


(Answer) Returns true if at least one expression is true; symbol ||.
Q35. What is NOT operator?
(Answer) Converts true to false and vice versa; symbol !.

Q36. What is meant by operator precedence?


(Answer) Rules that determine the order in which operators are evaluated.

Q37. What is an expression?


(Answer) A combination of operands and operators that produces a value.

Q38. What are comments?


(Answer) Non-executable lines in code used for explanation; ignored by compiler.

Q39. What is a single line comment?


(Answer) Comment starting with // that occupies one line only.

Q40. What is multi line comment?


(Answer) Comment written between /* and */ spanning multiple lines.

Q41. What is prefix increment?


(Answer) ++x increments the value before using it.

Q42. What is postfix increment?


(Answer) x++ uses the value first, then increments it.

Q43. What is prefix decrement?


(Answer) --x decrements the value before using it.

Q44. What is postfix decrement?


(Answer) x-- uses the value first, then decrements it.

Chapter 10

Q1. What is input statement?


Ans. An input statement in C is an instruction used to take data from an input device like the keyboard.
Q2. What is output statement?
Ans. An output statement in C is used to send data from the program to an output device like the
monitor.
Q3. What are standard input functions?
Ans. Standard input functions in C are: scanf(), gets(), getch(), and getche().
Q4. What are standard output functions?
Ans. Standard output functions in C are: printf() and puts().
Q5. What is printf() function?
Ans. printf() is a standard C function used to display output on the monitor.
Q6. What is a format specifier?
Ans. A format specifier tells how a value should be displayed and starts with the % symbol.
Q7. What is field width in format specifier?
Ans. Field width specifies the minimum number of columns used to display a value on the screen.
Q8. What is an escape sequence?
Ans. An escape sequence is a special character combination (like \n, \t) used to control output format.
Q9. What is getch() function?
Ans. getch() reads a single character input without displaying it or needing the Enter key.
Q10. What is getche() function?
Ans. getche() reads and displays a single character input without needing the Enter key.
Q11. What is the function of \n escape sequence?
Ans. \n moves the cursor to the beginning of the next line.
Q12. What is the function of \t escape sequence?
Ans. \t moves the cursor forward by one tab space.

Chapter 11

Q1. What is Control structure?


Ans. A control structure is a statement used to control the flow of execution in a program. It combines instructions
into a single unit with one entry and one exit point. Types: Sequence, Selection, Repetition.

Q2. What is meant by sequence structure?


Ans. In sequence structure, instructions execute one after the other in the order written. It is the default flow of a
program.

Q3. What is meant by selection structure?


Ans. In selection structure, the program executes one of multiple instruction groups based on a condition.

Q4. What is meant by repetition structure?


Ans. Repetition structure (or loop) executes a statement/set of statements repeatedly while a condition is true.
Types: while, do-while, for.

Q5. What is IF statement?


Ans. The if statement executes a statement only if a given condition is true. Syntax: if(condition) statement;

Q6. What is compound statement?


Ans. A group of statements enclosed in curly brackets {} is called a compound statement or block of code.

Q7. What is if-else statement?


Ans. The if-else statement executes one of two code blocks depending on whether a condition is true or false.

Q8. What is if-else-if statement?


Ans. The if-else-if statement selects one block from multiple options based on which condition is true.

Q9. What is conditional operator?


Ans. It is a shorthand for simple if-else. Syntax: (condition) ? statement1 : statement2;

Q10. What is switch statement?


Ans. A switch statement selects one block to execute based on the value of an expression. It is an alternative to if-
else-if.

Q11. What is nested if statement?


Ans. When one if statement is placed inside another if, it is called a nested if statement.

Q12. What is break statement?


Ans. The break statement ends the current loop or switch block and transfers control to the statement after it.
Chapter 12

Q1. What is Control structure?


Ans. A control structure controls the flow of execution in a program. It combines instructions into a logical unit with
one entry and exit. Types: Sequence, Selection, Repetition.

Q2. What is meant by sequence structure?


Ans. Sequence structure executes instructions one after another in the order written. It is the default flow of a
program.

Q3. What is meant by selection structure?


Ans. In selection structure, only a selected group of instructions are executed based on a condition.

Q4. What is meant by repetition structure?


Ans. Repetition (loop) structure executes a statement or block repeatedly while a condition is true. Types: while, do-
while, for.

Q5. What is IF statement?


Ans. if is a keyword used to execute a statement only if a condition is true. Syntax: if(condition) statement;

Q6. What is compound statement?


Ans. A group of statements enclosed in curly brackets {} is called a compound statement or code block.

Q7. What is if-else statement?


Ans. if-else is used to choose between two code blocks. One is executed based on the condition, the other is
skipped. Syntax: if(condition) statement; else statement;

Q8. What is if-else-if statement?


Ans. It is used when we need to choose one block from multiple options based on conditions. Syntax:

c
CopyEdit
if(condition1) statement1;
else if(condition2) statement2;
...
else defaultStatement;

Q9. What is conditional operator?


Ans. It is a shorthand for if-else. Syntax: (condition) ? statement1 : statement2; It executes statement1 if
condition is true, else statement2.

Q10. What is switch statement?


Ans. It is an alternative to if-else-if used to select from multiple blocks based on expression value. Syntax:

c
CopyEdit
switch(expression) {
case const1: statements; break;
case const2: statements; break;
default: statements;
}
Q11. What is nested if statement?
Ans. An if statement inside another if is called nested if. Syntax:

c
CopyEdit
if(condition1) {
if(condition2) {
statement;
}
}

Q12. What is break statement?


Ans. break is used to exit from a code block, usually a loop or switch. In switch, it exits the case and transfers
control outside the block.

Chapter 13

Q1. What is modular programming?


Ans. A programming technique where a program is divided into independent parts called modules or functions, each
performing a specific task.

Q2. What is a function?


Ans. A named piece of code developed to perform a specific task. It is also called a module.

Q3. Why functions are used?


Ans. Functions make programming easy, allow modification, debugging, reuse of code, eliminate duplication, and
reduce development time.

Q4. What are built-in functions?


Ans. Functions provided by the C language and stored in header files. They are also called library functions.

Q5. What are user defined functions?


Ans. Functions written by the programmer to perform specific tasks as per program requirements.

Q6. What is function prototype?


Ans. Function prototype or declaration provides the compiler with the structure of the function. It ends with a
semicolon and can be written before or inside main().

Q7. What is function definition?


Ans. The actual code or set of instructions of a function written outside the main() function.

Q8. What is function header?


Ans. The first line of the function definition, written as: Return-Type Name(parameters)

Q9. What is function calling?


Ans. A statement used to call a function using its name followed by parentheses with parameters, ending in a
semicolon.

Q10. What is return statement?


Ans. The return keyword is used to send a value from a called function back to the calling function. Syntax:
return expression;
Q11. What are parameters?
Ans. Also called arguments, parameters are values passed to a function during a function call, written inside
parentheses and separated by commas.

Q12. What is a local variable?


Ans. A variable declared inside a function. It is temporary and exists only during the function's execution. Syntax:
auto data-type variable-name;

Q13. What is global variable?


Ans. A variable declared outside all functions. It can be accessed and modified by all functions in the program.

Q14. What is meant by life time of a variable?


Ans. Local variables are created when a function is called and destroyed when the function ends, making their data
inaccessible afterward.

Q15. What is meant by scope of a variable?


Ans. The range within which a variable can be accessed. Local variables are accessible only within the function they
are declared in.

Q16. What is scope of global variable?


Ans. Global variables can be accessed and modified by all functions in a program.

Q17. What is life time of global variable?


Ans. Global variables exist from the start of program execution until the program ends.

Chapter 14

Q1. What is data file?


Ans. A data file is a collection of related records stored permanently. A record is a collection of fields.

Q2. What is stream?


Ans. The flow of data from one point (source) to another (destination) is called a stream.

Q3. What are different types of streams?


Ans. Input stream, Output stream, Binary stream, and Text stream.

Q4. What is text stream?


Ans. A flow of characters converted into bytes. There's no one-to-one relation between characters and bytes.

Q5. What is binary stream?


Ans. A flow of bytes with one-to-one correspondence between stored and transferred bytes. Used for any data type.

Q6. What is input stream?


Ans. Data flow from a source to a program, e.g., reading data from a file.

Q7. What is output stream?


Ans. Data flow from a program to a destination, e.g., writing data to a file.

Q8. What is pointer?


Ans. A special variable that stores the memory address of another variable. Its type must match the variable it points
to.
Q9. What is file pointer?
Ans. A pointer of type FILE that contains information about an opened file and is used to read/write data files.

Q10. What is meant by EOF?


Ans. A special end-of-file marker used to detect the end of a text file. Represented as EOF in C.

Q11. What is a string?


Ans. A collection of characters enclosed in double quotes. Stored using character arrays in C.

Q12. What is the purpose of fopen() function?


Ans. Used to open a file for reading or writing. Returns a file pointer and is defined in stdio.h.

Q13. What is the purpose of fputs() function?


Ans. Writes a string to a file. Syntax: fputs(string, file_pointer);

Q14. What is the purpose of fgets() function?


Ans. Reads a string from a file. Syntax: fgets(str, n, file_pointer);

Q15. What is the purpose of putc() function?


Ans. Writes a single character to a file. Syntax: putc(character, file_pointer);

Q16. What is the purpose of getc() function?


Ans. Reads a single character from a file. Can be used repeatedly to read more.

Q17. What is the purpose of fprintf() function?


Ans. Writes formatted data to a file. Syntax: fprintf(fp, format_string, argument);

Q18. What is the purpose of fscanf() function?


Ans. Reads formatted data from a file. Syntax: fscanf(fp, control_string, var);

Q19. What is the purpose of fclose() function?


Ans. Closes an opened file, transfers data back to secondary storage, and breaks connection with the C program.

You might also like