Spread the love

Chapter 1 short Questions and answers

Long Questions of Chapter 1

  1. Define File? Explain usage point of view of files.
  2. Define File ?Explain Storage/Access point of view of files
  3. Define database? Explain different components of database system.
  4. Define database Models? Explain different types in details
  5. Write down advantages and disadvantages of data base management

Chapter No 3

Long Questions.

  1. Define Database Modeling? Explain its ingredients in detail.
  2. What elements combined to produce physical data base design? Explain
  3. Define Database design process? Explain processes with diagram.
  4. Define Logical database design process? Explain its parts with diagram
  5. Define data distribution strategies? Explain with the help of example.

Chapter 4

Chapter 5

Chapter 6


Long Questions.

  1. What are queries? Explain different types of queries.
  2. Explain different types available in MS Access?

Chapter 7

Long Questions

  1. What is form? Explain it uses and advantages.
  2. Define Reports? Explain its types and uses

Chapter 8

short questions

Q.No1:What is an assembler?

An assembler is a translating program that translates the instructions of assembly language in to machine language.

Q.No3:What is structured programming language?

In structured programming languages, the entire logic of the program is divided into number of smaller modules of functions. Each module is a piece of code that implements different functionality.

Q.No4:What is a programmer?

A programmer is person that writes/create computer software or applications is called a programmer.

Q.No5: What is main () function used in ‘C’ program?

The main () function is the place where the execution of C program starts. When the program is executed, the control enters main () and starts executing its statements.

Q.No6: What is delimiters?

The statements of the program are written in curly braces. The curly brace {is called opening brace and} is called closing brace. These braces are also known as delimiters.

Q.No7: What are different types of errors in C program?

There are 03 types of errors that can occur while writing a C program. These errors are syntax errors, logical errors, and run-time errors.

Q.No8: Define logical error?

A type of error that occurs due to the poor logic of the programmer is known as logical error. A statement with logical error may be produce unexpected and wrong results in the program.

Q.No9:Why logical error is more difficult error?

The logical error is most difficult error because it cannot be detected by the compiler.it does not crash the program, that’s why it’s difficult to detect. The user need to review the whole program to find out the logical error.

Q.No10: What is the concept of header file?

Header files are the collection of standard library functions to perform different tasks. Each header file include different types of predefined function. The extension of header file is .h.

Q.No11: Define interpreter?

Interpreter is a program that converts one statement of a program in to machine at one time.it executes a statement before translating the next statement of the source program. If there is an error on the statement, the interpreter stops working and displays the error message.

Q.No12:Difference between syntax and logical error?

A syntax error occurs when an instruction is not written according to the rules of the programming language . A logical error occurs due to poor logic of a programmer. The language translator detects syntax errors but logical errors are difficult to find.

Q.No13:What is a pre-processor directive?

Pre-processor directive is an instruction given to the compiler before the execution of actual program .pre-processor is also known as compiler pre-processor. The pre-processors directives are processed by a program known as pre-processor.

Q.No14:Define constant macro with example?

Constant macro is a name that is replaced by a specific constant value before the program is sent to the computer. #define directives is used to define constant macro as follows

#define PI 3.142857

Q.No15:Define syntax error?

A syntax error occurs when an instruction is not written according to the rules of the programming language .A program contain syntax error cannot be compiled successfully.

Typing ‘forr’ instead of ‘for’ is an example of syntax error.

Q.No16:Define Compiler?

A compiler is a program that converts the instruction of high level language into machine language as a whole, so that they can be read and executed by a computer. The machine code can be executed many times.

Q.No17:Define high level language?

A high-level language is any programming language that near to human and far computer hardware different types of high level languages are c,c++,java etc

Q.No18:what are four common uses of high level programming language?

Four uses of High level programming language are

-Easy to learn.

-It is machine independent language.

-High level programming results in better programming productivity.

-High level languages are programmer friendly. They are easy to write, debug and maintain.

Define Linker

Define Loder.

Define source code and object code

A code written in high level language is called source code that code need translator for execute.

A program written in machine language is called object code that run directly

Who is programmer.

A person that who write a program is known as programmer

Define structure and unstructured programming

In structure programming program divide into multiple modules is called structure program that is easy to modify ,easy to manage.

In unstructured programming all program written in single module is called unstructured program it is difficult to manage

Long Questions.

  1. Define language processor or translator. Discuss different types of language processor.
  2. What is debugging? Explain different types of errors in a program.
  3. What is bug? Explain different types of errors in C-Language.
  4. Explain different steps from creation to execution of a C-Program.
  5. What is programming language ?explain different types of programming languages.

Chapter 9

short questions

Q No 01 Write given statement in C language? Z= (3*y) ( + b²)

Z= (3*y) * (a*a + b*b)

Define variable declaration.

The process of naming variable name and its type is called variable declaration.

Example : int a;

Define variable initialization.

The process of assigning value on the time of declaring is called variable inititalization.

Example : int a=10;

Define overflow.

When  assigned the maximum value of its  range then the error occur  is called overflow.

Example : int a=32770

 int range 32767 the value increase its range so this ones is called overflow

define underflow.

When  assigned the minimum value of its  range then the error occur  is called underflow.

Example : int a= – 32800

 int range -32768 the value decreases its range so this ones is called underflow.

Define assignment statement

A statement that assign a value that statement called assignment statement.

Example     a= 8;

Define L value and R value.

Right side value of assignment operator  is called R value  example    a=10  , 10 is R value.

Left  side value of assignment operator  is called L value  example    a=10  , a is L value.

Q No 02Define Expression?

A statement that evaluates to a value is called an expression. An expression gives a single value. An expression consist of operators and operands.example  a=b+c;

Q No 03What is Arithmetic expression?

A type of expression in which only arithmetic operators are used are called arithmetic expression. An arithmetic expression may contain integers floating point numbers.

Example a+b,a-b,a*b,a/b,a%b

Q No 04Define Relational operator?

The relational operators are used to specify conditions in programs. They compare two values and produce result as true or false.example<,>,<=,>=,==,!=

Q No 05Give examples of invalid variables?

Four examples are

  • 1Var
  • Var 2
  • Var.2

Q No 06Define explicit casting?

Explicit casting is performed by programmer.it is performed by using cast operator. They cast operator tells the computer to convert the data type of a value. Example int(a)

Q No 07Define keywords and give examples?

Key word is a word in C language that has a predefined meaning and purpose. The meaning and purpose of a key word is defined by the developer of the language.it cannot be changed or redefined by the user. Keyword can be used for the same purpose for which it is defined. Keywords are written in lower case.

Examples are auto, break, case, char etc.

Q No 08Differentiate between “Area” and Area?

The literal string “area” is a string constant value. The identifier area is a variable to store a value.

Q No 09 Define assignment statement?

A statement that assigns a value to a variable is known as assignment statement. The assignment operator = is used in assignment to assign a value or computational. Example a=b+c;

The name of variable is written on the left side of the assignment and the value is written on the right side of the assignment operator. The value can be a constant variable, expression or function.

No 11 what are the types of constants?

C language provides three types of constants. These are numeric constants,character constants and string constants. The examples of numeric constants are 10, -5 and 5.7 etc. The examples of character constants are ‘A’, ’=’ and ‘$’ etc.The string constant “abc” and ”123” etc

Q No 12What is operator precedence?

The order in which different types of operators in an expression are evaluated is known as operator precedence. It is also known as hierarchy of operators.

Example !,*,/,%,+,-,<,<=, etc

Q No 13Define decrement operator?

The decrement operator is used to decrement the value of a variable by 1. It is denoted by the symbol – – . It is unary operator and works with single variable. Example –a,a–

Q No 14Write the following statement as a single statement?

int a =2; int b =3;int c=5;

int a =2, b=3,c=5;

Q No 15Define the term range?

The possible values that a floating type variable can store are described in terms of precision and range. 0.6534 * 10^3 in this example 3 is range and 4 is precision.

Q No 16 Define a variable?

A variable is a named memory location or memory cell. It is used to store a program’s input data and its computational results during execution. The value of a variable may be changed during the execution of program. However, the name of variable cannot be changed. For Example int marks; float average; char grade; double salary.

Q No 17 What is floating point Constants?

Floating point constants are numeric values with fraction or decimal point. Floating point constants represent values that are measured. Both positive and negative floating point constants are used in C programs.

Examples: 50.75 10.22 -13.42

Comments are the lines of the program that are not executed. The compiler ignores comments and does not include them in the executable program. That is why comments do not affect the size of executable program.

The basic purpose of comments are used to increase the readability of the program and use as a notes in program.

Two types

Single line example  //

Multiline  example/* this is comments*/.

Long Questions.

  1. What is operator? Write in details the operators used in C language.             i)  Logical operator        ii)  Relational operator

2. Define data type in C. Explain different types of datatype are available in C.

Chapter 10

short Questions

Q.No 01What is an escape sequence?

Escape sequences are special characters used in format string to modify the format of output. These characters are not displayed in the output. These characters always begin with backslash\”. The backslash is called escape character. Example \n,\b etc

Q No 02 Define Scanf function? 

Scanf function is used to get the input from the user. The input is stored in a variable in a specified form.

Example Scanf(“%d”,&a);

Q No 03What is the use of format specifier?

Format specifiers are used to specify the format according to which values will be read and displayed.it determines the data type of a variable, field width and format the value.example %d for integer ,float for %f ,char for %c and string for %s 

Q No 04What is a standard input?

The term standard input refers to the input using keyboard. A program may need certain input from the user for working properly. C function provides many functions to get input from user.

Example scanf(), for string input gets(),for char input getch() and getche()

Q No 05What is getch() or getche()?

The getch () function is used to input single character from the user. When the function is executed, it waits for any key to be pressed. The character entered by the user is not displayed on the screen.

Q No 06What is the use of ampersand (&) in scanf ()?

The symbol & indicates the memory location of the variable in which the output is stored. It is called ampersand or address operator.

Q No 07Difference between getch () and getche ()?

Getch and getche are used to input single character. When getch is used the character entered by the user does not appear on screen. When getche is used the character appears on the screen.

Q No 08 What is standard output?

The term standard output refers to the output displayed on the monitor. The result of a program is output of the program.Two  functions use in c printf(); and for string output function is puts();

Q no 9  Define Puts and Gets in C

Puts use for srting value to print on screen. And  gets use for string value get or input from user .

Q 10 Define clrscr();

Clrscr use for clear output screen this function use when conio.h  include on header

Q 11 write name of input and out put function in c.

Input function name are : scanf(),getch(),getche(),gets();

Output functions are : printf(); puts()

Long Questions.

Define printf() Explain in detail with the help of examples.

Define Scan() Explain in detail with the help of examples.

Chapter 11

short Questions

Q. No 01What is a selection structure?

A selection structure selects a statement or set of statements to execute on the basis of a condition. In this structure, statement or set of statements is executed when a particular condition is true and ignored when the condition is false. There are different types of selection structures. These are if, if-else, and switch.

Q. No 02What is switch statement?

The switch statement is another conditional structure.it is a good alternative of nested if-else. It can be used easily when there are many choices available and only one should be executed. Nested if becomes very difficult in such situation.

Q. No 03What is if-statement?

If is a key word in C language. If statement is a decision making statement.it is the simplest form of selection constructs. It is used to skip or execute a statement or set of statements by checking a condition.

Q. No 04What is conditional operator?

Conditional operator is a decision making structure. It can be used in place of simple if-else structure. It is also called ternary operator as it uses three operands.

Q. No 05Syntax of conditional operator?

The example of conditional operator is as follows

Z=(x<4)?6 : 8; if condition is true compiler save 6 in z and if false 8 save in z

The syntax of conditional operator is as follows

(Condition) true-case statement: false-case statement

Q. No 06What happened if BREAK statement is missed in CASE block?

If break is not used, all case blocks coming after matching case will also be executes.

Q. No 07Define compound statements?

A set of statements written in curly brackets {} after if statement is called compound statement.

Example

if(x>2){

Statments1;

Statements2;

} there is two statements

Q. No 08What is sequence structure?

In sequential structure the statements are executes in the same order in which they are specified in program. The control flows from one statement to another in a logical sequence. All statements are executed exactly once. It means that no statement is skipped and no statement is executed more than once.

Q. No 09What is compound condition? 

A type of condition in which more than one conditions are evaluated is called compound condition. It is used to execute a statement or set of statements by testing many conditions.

Example  if((a>b)&&(a>c))

Q. No 10Repetition structure?

A repetition structure executes a statement or set of statements repeatedly. It is also known as iteration structure or loop. The repeat ion structures includes for loop, while loop, and do-while loop.

Q. No 11What is if-else statement?

If else statement is another type of if statement. It executes one block of statements when the condition is true and the other when it is false.in any situation, one block is executed and the other is skipped.in if else statement.

-Both blocks of statement can never be executed.

– Both blocks of statement can never be skipped.

Long Questions.

  1. Write a program which inputs a number and tells whether it is even or odd.
  2. Write a program to input an integer and test whether the number is positive, negative or zero.
  3. What do you know about switch statement? Give example as well.
  4. Write a program that inputs a character from the user and check whether it is a vowel or consonant using if-statement
  5. Define structured programing. Explain control structure and different types of control structures.
  6. Write a program that inputs two numbers and finds whether there are equal or not.
  7. Write a program that input a yeat and finds whether it is leap year or not

Chapter 12

short Questions and answer

Q. No 01What is difference between while and do-while loop?

In while loop, condition comes before the body of the loop. If condition is false in beginning the statement is never been executed. The semicolon is never used at the end. Where as

In do-while loop, condition comes before the body of the loop.do-while is executed at least once even if the condition is false in the beginning. Semi colon is used after the condition.

Q. No 02Write uses of loops?/iteratioin/Repetition/couter loop

Loops are used to execute a statement or number of statements for a specified number of times. Loops are used to access the sequence of values.

Q. No 03Which three steps must be done using loop control variable?

The three steps that must be done using the loop control variable are initialization, test and increment/decrement.

Q. No 04Write the syntax of while loop with example?

While (condition)

Statement(s)

Example

int count=0;

            While (count < 10)

            {         

                        Printf (“C Programming”);

                        count++;

}

Q. No 05Write syntax of for loop?

For (initialization; condition; increment/decrement)

{

            Statement 1;

            Statement 2;

Statement N;

}

Example:

inti; n=4;

for (i = n   ; i> = 0;  i–)

printf (“Pakistan”);

Q. No 06What is nested loop?

A loop with in a loop is called nested loop. In nested loops, the inner loop is executed completely with each change in the value of counter variables of outer loop. Any loop can be used as inner loop of another loop. 

Q. No 08What is whileloop?

“While” loop is the simplest loop of C language. It executes one or more statements while the given condition remains true. It is useful where the number of iterations is not known in advance.

Q. No 09Write sentinel loop

Loops are used to execute a statement or number of statements that end with pressing any specific value.The number of iterations of sentinel controlled loop is unknown. It depends on the input from the user.

Q. No 010Write GotoSateement.

Goto use label and programmer Goto use for jump any other line using label call

Example  : goto label  or goto A

Long Questions

  1. Explain the working of while loop with flow chart and syntax.
  2. What is for loop structure? Explain its working with an example
  3. .Write a program that inputs a number from the user and display the table of that number using for loop.
  4. Write a program that inputs number then display the table.
  5. Write a program that displays product of all odd numbers from 1 to 10 using for loop.
  6. What is nested loop? Explain with example.
  7. Write a program that displays first ten numbers and their average using for loop.
  8. Write a program that inputs a number from the user and display the table of that number using while loop.

Chapter 13

Short questions. total 4 no marks

Q.No 01what is the use of formal parameter or dummy parameter?

The perameters in function declaration are called formal parameters. These parameters are used to receive values from the calling function. If two are more formal parameters are used, each parameter is separated by comma.

Example   fun(int a,int b) there are Two parameters a and b

Q.No 02What is the importance of function in C?

Firstly, the functions are easily to code and modify, secondly they are easily to maintain and debug, and they can be reused.

Q.No 03What is a function call?

The statement that activates a function is known as function call. A function is called with its name. Function name is followed by necessary parameters in parenthesis. If there are many parameters, these are separated by commas.

Example : fun();

Q.No 04What are benefits of a function?

Firstly, the functions are easily to code and modify, secondly they are easily to maintain and debug, and they can be reused.

Q.No 05What is local variables?

A variable declared inside a function is known as local variable. Local variables are also called automatic variables.

Q.No 06Define Function?

A function is a named block of code that performs some action. The statements written in a function are executed when it is called by its name.

Q.No 07Define actual parameter?

Actual parameters are the values that are passed to a function definition in function call. They may be constant values or variable names and they are used in function call. Example fun(5,7)

Q.No 08What is body of the function?

The set of statements which are executed inside the function is known as function body. The body of the function appears after function header. The statements are written in curly braces { }. The variable declaration and program logic are implemented in function body.

Q.No 10How it becomes easy to write a program by using function?

A lengthy program can be divided in to small function. It is easier to write small functions instead of writing a long program. A programmer can focus the attention on a specific problem. It makes the programming easier.

Q.No 11Difference between function definition and function declaration?

Function definition consist of different statements to perform a task. Function declaration consist of single statement that provides information to compiler about function. Function declaration is written in braces but function definition is not written in braces.

Q.No 12Name any three functions used in C?

Three functions commonly used in C language programs are printf (), scanf (), and getch ().The printf () function is used to display the output. The scanf function is used to get the input. The getch () function is used to input single character.

Q.No 13What is a lifetime of a local variable?

The time period for which a variable exists in the memory is known as lifetime of a variable. The life time of a local variable starts when control enters the function in which it is declared. Local variable is automatically destroyed when control exists from the function.

Q.No 14Define function definition?

A set of statements that explain what a function does is called function definition. The function definition consist of function header and function body.