## TN State Board 11th Computer Science Important Questions Chapter 10 Flow of Control

Question 1.
What is control flow?
The flow of control jumps from one part of the code to another segment of code. This is called as “control flow.”

Question 2.
How many kinds of statements are used in C++?
There are two kinds of statements used in C++.

1. Null statement
2. Compound statement

Question 3.
What do you mean by sequential statement?

1. The sequential statement are the statements, that are executed one after another only once from tqp to bottom.
2. They always end with a semicolon (;).

Question 4.
Write the general Syntax of the if statement.
if (expression)
true-block;
statement-x;

Question 5.
Write the three forms of nested if.

1. If nested inside if part
2. If nested inside else part
3. If nested inside both if part and else part.

Question 6.
Write the Syntax of the conditional operator.
The syntax of the conditional operator is: expression 1? expression 2 : expression 3

Question 7.
What is iteration statement?

1. An iteration (or looping) is a sequence of one or more statements that are repeatedly executed until a condition is satisfied.
2. These statements are also called as control flow statements.

Question 8.
What are the types of iteration statements?
C++ supports three types of iteration statements. They are:

1. for statement
2. while statement
3. do-while statement.

Question 9.
What are the four elements of a loop?
Every loop has four elements that are used for different purposes. These elements are

1. Initialization expression
2. Test expression
3. Update expression
4. The body of the loop.

Question 10.
State reason to prefer prefix operator over postfix.
The update expression contains increment/ decrement operator (++ or – -). In this part, always prefer prefix increment/decrement operator over postfix when to be used alone. The reason behind this is that when used alone, prefix operators are executed faster than postfix.

Question 11.
What is jump statement? Write the types of Jump statements are used to interrupt the normal flow of program.
Types of Jump Statements are:

1. goto statement
2. break statement
3. continue statement.

Question 12.
What is goto statement? Write the Syntax.
The goto statement is a control statement which is used to transfer the control from one place to another place without any condition in a program.
The syntax of the goto statement is;

Question 13.
When will the while loop be infinite? Give example.
A while loop may be infinite loop when no update statement inside the body of the loop. Eg:
int main( )
{
int i = 0;
while(i<=10)
cout<<“The value of i is”
<<i; → [This statement is infinitely displaying because no update statement inside body of the loop]
i++; → [This is not part of the loop statement because of missing curly braces]
return 0;
}

Question 14.
What is the use of update expression?
Update expression is used to change the value of the loop variable. This statement is executed at the end of the loop after the body of the loop is executed.

Question 15.
Write short note on iteration statement.

The iteration statement is a set of statement that are repetitively executed if the condition is true. As soon as the condition becomes false, the repetition stops. This is also known as looping statement or iteration statement.
The set of statements that are executed again and again is called the body of the loop. The condition on which the execution or exit from the loop is called exit-condition or test- condition.

Question 16.
What do you mean by If-else-if ladder?
The if-else ladder is a multi-path decision making statement.
if(expression 1)
{
Statement-1
}
else
if (expression 2)
{
Statement-2
}
else
if (expression 3)
{
Statement-3
}
else
{
Statement-4
}

When expression becomes true, the statement associated with block is executed and the rest of the ladder is bypassed. If none of the conditions is true, then the final else statement will be executed.

Question 17.
#include
using namespace std;
int main( )
{
int marks;
cout<<“Enter the Marks ; cin>>marks;
if(marks >= 60)
cout<<“Your grade is 1st class !!” <<endl; else if(marks >= 50 && marks < 60)
cout<<“your grade is 2nd class ! ! ” <<endl; else if(marks >= 40 && marks < 50)
else
cout<<“You are fail !!”<<endl;
return 0;
}
Output:
Enter the Marks :60

Question 18.
List down the rules for the switch statement?

1. The expression provided in the switch should result in a constant value otherwise it would not be valid.
2. Duplicate case values are not allowed.
3. The default statement is optional.
4. The break statement is used inside the switch to terminate a statement sequence.
5. The break statement is optional. If omitted, execution will continue on into the next case.
6. Nesting of switch statements is also allowed.

Question 19.
Explain how conditional operator works with example?
(i) The conditional operator (or Ternary operator) is an alternative for ‘if else statement’.
(ii) The conditional operator consists of two symbols (?:). It takes three arguments.
The syntax of the conditional operator is: expression 1 ? expression 2 : expression 3

Eg:
#include
using namespace std;
int main( )
{
int a, b, largest;
cout<<“\n Enter any two numbers:” ; cin>> a >> b;
largest = (a>b)? a : b;
cout<< “\n Largest number :”<< largest;
return 0;
}
Output:
Enter any two numbers: 12 98
Largest number : 98

Question 20.
Write some important points about switch statement.

1. A switch statement can only work for quality of comparisons.
2. No two case labels in the same switch can have identical values.
3. If character constants are used in the switch statement, they are automatically converted to their equivalent ASCII codes.
4. The switch statement is more efficient choice than if in a situation that supports the nature of the switch operation.
The switch statement is more efficient than if-else statement.

Question 21.
Write the while loop syntax and the control flow.
(i) A while loop is a control flow statement that allows the loop statements to be executed as long as the condition is true.
(ii) The while loop is an entry-controlled loop because the test-expression is evaluated before entering into a loop.
The while loop syntax is:
while(Test expression)
{
Body of the loop;
}
Statement-x;
The control flow and flow chart of the while loop is shown below.

while loop control flow and while loop flowchart.

Question 22.
What do you mean by empty loop?
Empty loop means a loop has no statement in its body is called an empty loop. Following for loop is an empty loop:
for (i+0; i<=5; +=i)(;) → the body of for loop contains a null statement.
In the above statement, the for loop contains a null statement, it is an empty loop.

Question 23.
What do you mean by nested switch? Write the Syntax.
(i) When a switch is a part of the statement sequence of another switch, then it is called as nested switch statement.
(ii) The inner switch and the outer switch constant may or may not be the same.
The syntax of the nested switch statement is:
switch(expression)
{
case constant 1:
statement(s);
break;
switch(expression)
{
case constant 1:
statement (s);
break;
case constant 2:
statement(s);
break;
.
.
.
default :
statement(s);
}
case constant 2:
statement(s);
break; .
default :
statement (s);
}

Question 24.
How will you give multiple initialization and multiple update expressions in for loop?
(i) Multiple statements can be used in the initialization and update expressions of for loop.
(ii) These multiple initialization and multiple update expressions are separated by commas.
Eg:

Output:
The value of i is 0 The value of j is 10
The value of i is 1 The value of j is 9
The value of i is 2 The value of j is 8
The value of i is 3 The value of j is 7
The value of i is 4 The value of j is 6

Question 25.
Write a short note on break with and show the working of break with different looping statements.
A break statement is a jump statement which terminates the execution of loop and the control is transferred to resume normal execution after the body of the loop. The following Figure, shows the working of break statement with looping statements:

Question 26.
What is continue statement? Give the work flow of a continue statement in different statements.
The continue statement works quite similar to the break statement. Instead of terminating the loop (break statement), continue statement forces the loop to continue or execute the next iteration.
The following Figure describes the working flow of the continue statement:

Question 27.
Write a C++ program to get the following output: 1 2 3 4 5 7 8 9 10
#include
using namespace std;
int main ( )
for(int i = 1; i<= 10; i++)
{
if (i == 6) continue; else
cout«i« ” “;
}
return 0;
}
Output:
1 2 3 4 5 7 8 9 10

Question 28.
Differentiate break and continue statement?

 Break Continue Break is used to terminate the execution of the loop. Continue is not used to terminate the execution of loop. It breaks the iteration. It skips the iteration. When this statement is executed, control will come out from the loop and executes the statement immediately after loop. When this statement is executed, it will not come out of the loop but moves/jumps to the next iteration of loop. Break is used with loops as well as switch case. Continue is only used in loops, it is not used in switch case.

Question 29.
What will be output for the given code below?
#include
using namespace std;
int main( )
{
int count=0; do
{
cout<<“count:”<<count<<endl; count ++; if(count>5)
{
break;
}
}while(count<20);
return 0;
}
Output:
count : 0
count : 1
count : 2

Question 30.
Write a C++ program to display number from 10 to 1 using do-while loop.
#include
using namespace std;
int main( )
{
int n = 10;
do
{
cout<<n<<“,”; n–; }while(n > 0);
}
Output;
10, 9, 8, 7, 6, 5, 4, 3, 2, 1

Question 31.
What do you mean by the body of the loop?
The body of the loop:

1. A statement or set of statements forms a body of the loop that are executed repetitively.
2. In an entry-controlled loop, first the test- expression is evaluated and if it is non-zero, the body of the loop is executed otherwise the loop is terminated,
3. In an exit-controlled loop, the body of the loop is executed first then the test- expression is evaluated.

Question 32.
Explain if and if-else statement with suitable example.
if statement:
The if statement evaluates a condition, if the condition is true then a true-block (a statement or set of statements) is executed, otherwise the true-block is skipped. The general syntax of the if statement is:
if (expression)
true-block;
statement-x;

In the above syntax, if is a keyword that should contain expression or condition which is enclosed within parentheses. If the expression is true (non-zero) then the true-block is executed and followed by statement-x are also executed, otherwise, the control passes to statement-x. The true-block may consists of a single statement, a compound statement or empty statement. The control flow of if statement and the corresponding flow chart is shown below.

C++ Program to check whether a person is eligible to vote using if statement.
#include
using namespace std;
int main( )
{

}
Output:
You are eligible for voting….
This statement is always executed.

if-else statement:
In the above example of if, allows to execute a set of statement if a condition evaluates to true. What if there is another course of action to be followed if the condition evaluates to false. There is another form of if that allows for this kind of either or condition by providing an else clause. The syntax of the if-else statement is given below:
if(expression)
{
True-block;
}
else
{
False-block;
}
Statement-x
In if-else statement, first the expression or condition is evaluated either True of false.
If the result is true, then the statements inside true-block is executed and false-block is skipped. If the result is false, then the statement inside the false-block is executed i.e., the true-block is skipped.

C++ program to find whether the given number is even number or odd number using if-else statement.
#include
using namespace std;
int main( )
{
int num, rem;
cout<<“\n Enter a number:”; cin>>num;
rem = num%2;
if(rem==0)
cout<<“\n The given number”<<num<“is Even”;
else
cout<<“\n The given number”<<num<<“is Odd”;
return 0;
}

Output:
Enter number: 10
The given number 10 is Even
In the above program, the remainder of the given number is stored in rem. If the value of rem is zero, the given number is inferred as an even number otherwise, it is inferred as on odd number.

Question 33.
Give the key difference between if-eise and switch.
“if-else” and “switch” both are selection statements. The selection statements, transfer the flow of the program to the particular block of statements based upon whether the condition is “true” or “false”. However, there are some differences in their operations. These are given below:
Key Differences Between if-else and switch:

 if else switch Expression inside if statement decide whether to execute the statements inside if block or under else block. expression inside switch statement decide which case to execute. An if else statement uses multiple statements for multiple choices. switch statement uses single expression for multiple choices. If esle statement checks for equality as well as for logical expression. switch checks only for equality. The if statement evaluates integer, character, pointer or floating point type or Boolean type. switch statement evaluates only character or a integer data type. Sequence of execution is like either statement under if block will execute or statements under else block statement will execute. The expression in switch statement decide which case to execute and if do not apply a break statement after each case it will execute till the end of switch statement. If expression inside if turn out to be false, statement inside else block will be executed. If expression inside switch statement turn out to be false then default statements are executed. It is difficult to edit if else statements as it is tedious to trace where the correction is required. It is easy to edit switch statements as they are easy to trace.

Question 34.
What do you mean by nested if statement? Explain with suitable example.
An if statement contains another if statement is called nested if. The nested can have one of the following three forms.
(i) If nested inside if part
(ii) If nested inside else part
(iii) If nested inside both if part and else part The syntax of the nested if:
If nested inside if part
if (expression-1)
{
if (expression)
{
True_Part_Statements;
}
else
{
False_Part_Statements;
}
}
else .
body of else part;
If nested inside else part
if(expression-1)
{
body of true part;
}
else
{
if(expression}
{
True_Part_Statements;
}
else
{
False_Part_Statements ;
}
}
If nested inside both if part and else part
if (expression)
{
if (expression)
{
True_Part_Statements;
}
else
{
False_ Part_Statements;
}
}
else
{
if (expression)
{
True_Part_Statements;
}
else
{
False_Part_Statements;
}
}
In the first syntax of the nested if mentioned above the expression-1 is evaluated and the expression result is false then control passes to statement-m. Otherwise, expression-2 is evaluated, if the condition is true, then Nested- True-block is executed, next statement-n is also executed. Otherwise Nested-False-Block, statement-n and statement-m are executed.

The working procedure of the above said if..else structures are given as flowchart below:

C++ program to calculate commission according to grade using nested if statement
#include
using namespace std;
int main ( )
{
int sales, commission;
cout<<”\n Enter Sales amount:”; cin>>sales;
if (sales > 5000)
commission = sales*0 . 10;
cout<<”\n Commission:”<<commission;
}
else
{
commission = sales * 0.05;
cout<<”\n Cornmission:”<< commission;
}
cout<<”\n Good Job . . . . . .“;
return 0;
}
Output:
Enter Sales amount: 6000
Commission: 600
Good Job . . . . . .

Question 35.
Write a C++ program to demonstrate switch statement.
#include
using namespace std;
int main ( )
{
{
case ‘A’ : cout<< “\n
Excellent…”;
break;
case ‘B’ :
case ‘C’ : cout<< “\n Welldone . . . .”;
break;
case ‘D’ : cout<< “\n You passed . . . .”;
break;
case ‘ E’ : cout<< “\n Better try again . . . .”;
break;
default : cout<<“\n Invalid Grade . . . .”;
}
return 0;
}
Output:
Welldone . . .

Question 36.
Explain in detail the parts of a loop.
Every loop has four elements that are used for different purposes. These elements are:

1. Initialization expression
2. Test expression
3. Update expression
4. The body of the loop

Initialization expression(s):
The control variable(s) must be initialized before the control enters into loop. The initialization of the control variable takes place under the initialization expressions. The initialization expression is executed only once in the beginning of the loop.

Test Expression:
The test expression is an expression or condition whose value decides whether the loop-body will be execute or not. If the expression evaluates to true (i.e., 1), the body of the loop executed, otherwise the loop is terminated. In an entry-controlled loop, the test-expression is evaluated before entering into a loop whereas in an exit-controlled loop, the test-expression is evaluated before exit from the loop.

Update expression:
It is used to change the value of the loop variable. This statement is executed at the end of the loop after the body of the loop is executed.

The body of the loop:
A statement or set of statements forms a body of the loop that are executed repetitively. In an entry-controlled loop, first the test-expression is evaluated and if it is non-zero, the body of the loop is executed otherwise the loop is terminated. In an exit-controlled loop, the body of the loop is executed first then the test-expression is evaluated. If the test-expression is true the body of the loop is repeated otherwise loop is terminated.

Question 37.
Explain the for loop with suitable example.
The for loop is the easiest looping statement which allows code to be executed repeatedly. It contains three different statements (initialization, condition or test-expression and update expression(s)) separated by semicolon.
The general syntax is:
for(initialization (s); test- expression; update expression(s))
{.
Statement 1;
Statement 2;
……….
}
Statement – x;

The initialization part is used to initialize variables or declare variable which are executed only once, then the control passes to test-expression. After evaluation of test- expression, if the result is false, the control transferred to statement-x. If the result is true, the body of the for loop is executed, next the control is transferred to update expression. After evaluation of update expression part, the control is transferred to the test-expression part. Next the steps 3 to 5 is repeated. The workflow of for loop and flow chart are shown below.

C++ program to display numbers from 0 to 9 using for loop.
#include
using namespace std;
int main( )
{
int i;
for(i=0;i<10;i++)
cout<<“value of i :”<<i<<endl;
return 0;
}
Output:
value of i : 0
value of i : 1
value of i : 2
value of i : 3
value of i : 4
value of i : 5
value of i : 6
value of i : 7
value of i : 8
value of i : 9

Question 38.
Explain the do-while loop with suitable example.

The do-while loop is an exit-controlled loop. In do-while loop, the condition is evaluated at the bottom of the loop after executing the body of the loop. This means that the body of the loop is executed at least once, even when the condition evaluates false during the first iteration.
The do-while loop syntax is:
do
{
Body of the loop;
} while(condition);
C++ program to display number from 10 to 1 using do-while loop
#include
using namespace std;
int main( )
{
int n = 10; do
{
cout<<n<<“, “; n–; } while(n>0) ;
}
Output:
10, 9, 8, 7, 6, 5, 4, 3, 2, 1

In the above program, the integer variable n is initialized to 10. Next the value of n is displayed as 10 and n is decremented by 1. Now, the condition is evaluated, since 9 > 0, again 9 is displayed and n is decremented to 8. This continues, until n becomes equal to 0, at which point, the condition n > 0 will evaluate to false and the do-while loop terminates.

Question 39.
Explain the while loop variation.
A while loop may contain several variations. It can be an empty loop or an infinite loop. An empty while loop does not have any statement inside the body of the loop except null statement i.e., just a semicolon.
Eg:
int main ( )
{
int i=0;
while (++i<10000)
→ [This is an empty loop because the while loop does not contain ‘ any statement]
return 0;
}
}
In the above code, the loop is a time delay loop. A time delay loop is useful for pausing the program for some time.
A while loop may be infinite loop when no update statement inside the body of the loop.
Eg:
int main( )
{

}

Similarly, there is another variation of while is also shown below:

int main( )
{
int i=1;
while(++i < 10)
cout<<“The value of i is”<<i;
return 0;
}
In the above statement while (++i < 10), first increment the value of i, then the value of i is compared with 10.
int main( )
{
int i=1;
while(i++ < 10)
cout<<“The value of i is”<<i;
return 0;
}
In the above statement while (i++ < 10), first the value of i is compared with 10 and then the incrementation of i takes place. When the control reaches cout<< “The value of i is”<

Question 40.
Write C++ program to solve the following problems.
1. Temperature – conversion program that gives the user the option of converting Fahrenheit to Celsius or Celsius to Fahrenheit and depending upon user’s choice.
#include
using namespace std;
int main( )
{
int res;
double – temp;
cout<,”\n Type 1 to convert fahrenheit to Celsius”
<<“\n Type 2 to convert Celsius to fahrenheit:; cin>>res;
if(res=1)
{
cout<<“Enter temperature in fahrenheit:”; cin>>temp;
cout<<“In Celsius”<<5.0/9.0* (temp-32.0);
}
else
{
cout<<“Enter temperature in Celsius:”; cin>>temp;
cout<<“In fahrenheit”<<9.0/5.0* temp +32.0;
}
cout<<endl;
return 0;
}
Output:
Type 1: to convert fahrenheit to Celsius
Type 2: to covert Celsius to fahrenheit :1 .
Enter temperature in fahrenheit : 120
In Celsius 48.8889

Question 41.
The program requires the user to enter two numbers and an operator. It then carries out the specified arithmetical operation: addition, subtraction, multiplication or division of the two numbers. Finally, it displays the result.
#include
using namespace std;
int main( )
{
char option;
float num1, num2;
cout<<“enter operator either+(or)-(or)* (or)1:”; cin>>option;
cout<<“enter first operand:”; cin>>num1;
cout<<“\n enter second operand:”; cin>>num2;
switch(option)
{
case’+’
cout<<num1+num2;
break;
case’-‘
cout<<num1-num2;
break;
case’*’ ,
cout<<num*num;’
break;
case’/’
cout<<numl/num2;
break;
default:
cout<<“error! Operator is not correct”;
break;
}
return 0;
}
Output:
Enter operator either +(or) – (or) * (or) / : +
Enter first operand: 2
Enter second operand:3
5

Question 42.
Program to input a character and to print whether a given character is an alphabet, digit or any other character.
#include
using namespace std;
int main( )
}
char ch;
cout<<“Enter any character”; cin>>ch;
//Alphabet checking condition
if((ch>=’a’ && ch<=’z’) || (ch>=’A’ && ch<= ‘Z’))
{
cout<<ch<<“is an Alphabet”; } else if(ch>=’0′ && ch<=’9′)
{
cout<<ch<<“is a Digit”;
}
else
{
cout<<ch<<“is a special character”;
}
return 0;
}
Output:
Enter any character :8
8 is a Digit

Question 43.
Program to print whether a given character is an uppercase or a lowercase character or a digit or any other character, use ASCII codes for it. The ASCII codes are as given below:

 Characters ASCII Range ‘0’ – ‘9’ 48 – 57 ‘A’ – ‘Z’ 65 – 90 ‘a’ – ‘z’ 97 – 122 Other characters 0 – 255 excluding the above mentioned codes.

#include
using namespace std;
int main( )
{
char ch;
cout<<“Enter any character:”; cin>>ch;
if(ch>=65 && ch<=90)
cout<<endl<<ch<<“uppercase character”; else if(ch>=48 && ch<=57)
cout<<endl<<ch<< “a digit”; else if(ch>=97 && ch<=22)
cout<<endl«ch<<” lowercase character”;
else
cout<<endl<<ch<<“a special character”;
return 0;
}
Output:
Enter any character: D
Uppercase character

Question 44.
Program to calculate the factorial of an integer.
#include
using namespace std;
int main( )
{
unsigned int n;
unsigned long factorial =1;
cout<<“enter a integer:”; cin>>n;
for (int i-;i<=n;++i)
{
factorial *=i;
cout<<“factorial of “<<n<<“=”<<factorial;
return 0;
}
Output:
Enter a integer:2
Factorial of 12=479001600

Question 45.
Program that print 1 2 4 8 16 32 64 128.
#include
using namespace std;
int main ( )
{
int j;
for(i=i; i<128; i*=2)
cout<<i<<“ “;
return 0;
)

Question 46.
Program to generate divisors of an integer.
#include
using namespace std;
int main( )
(
long int n, j;
cout<<”Enter the number:”; cin>>n;
cout<<endl<<”Divisor of”<> “are”;
for(i = i; i<=n;++i)
{
if (n%i==0)
cout<<” d “<<j;
)
return 0;
Output:
Enter the number : 6
Divisors of 6 are 1 2 3 6

Question 47.
Program to print fibonacci series i.e., 0 1 1 2 3 5 8 ….
#include
using namespace std;
int main( )
mt n1=0, n2=1, n3, i, number;
count<<”enter the number of elements :“; cin>>number;
for (i=0; i<number; i++)
{
n3=n1+n2;
cout<<n3<<” “;
n1=n2;
n2=n3;
}
return 0;
}
Output:
Enter the number of elements:10
0 1 1 2 3 5 13 21 34

Question 48.
Programs to produces the following design using nested loops.

(a)
#include
using namespace std;
int main( )
{
char S[ ] = “ABCDEF”
for(int i=0;s[i];++i)
{
for(int j=0;j<=i;++j;
{
cout<<S[j]<<” “;
}
cout<<endl;
}
return 0;
}
Output:
A
A B
A B C
A B C D
A B C D E
A B C D E F

(b)
#include
using namespace std;
int main( )
{
int rows;
for (int i=1; i<=5; ++i) { for (int j =5; j>=i; –j)
{
cout<<j<<” “;
}
cout<<“\n”;
}
return 0;
}
Output:
5 4 3 2 1
5 4 3 2
5 4 3
5 4
5

(c)
#include
using namespace std;
int main( )
{
for (int i=4; i>=1; –i)
{
for (int k=0; k<4-i; ++k)
cout<<” “;
for(int j=i; j<2*i-1; ++j)
{
cout<<“#”;
}
for(j=0;j<i-l;++j) cout«”#”; cout«”\n”;
}
return 0;
}
Output:

Question 49.
Program to check whether square root of a number is prime or not.
#include
#include using namespace std;
int main( )
{
int x, y=1, z, i;
cout<<“Enter a Number ; cin>>x;
z=sqrt(x);
cout<<“\nSquare Root is : “«z;
if(z==1)
{
cout<<“\nThe Number is Not Prime”;
}
else
{
for(i=2; i<z; i++)
{
if(z%i == 0)
{
y = 0;
break;
}
}
if(y == 1)
{
cout<<“\n”<<z<<“is a Prime Number”;
}
else
{
cout<<“\n”<<z<< “is Not a Prime Number”; } } return 0; } Output: Enter a Number: 16 Square Root is: 4 4 is Not a Prime Number.

Question 50.
What is a null statement and compound statement?
The “null or empty statement” is a statement containing only a semicolon. It takes the flowing form: ; // it is a null statement Compound (Block) statement: C++ allows a group of statements enclosed by pair of braces { }. This group of statements is called as a compound statement or a block. The general format of compound statement is: { statement1; statement2; statement3; } For example { int x, y; x = 10; y = x + 10; }

Question 51.
What is selection statement? Write it’s types?
The selection statement means the statement (s) are executed depending upon a condition. If a condition is true, a true block (a set of statements) is executed otherwise a false block is executed. The types of selection statement are:

1. if statement
2. if-else statement
3. Nested if statement
4. Switch statement

Question 52.
Correct the following code segment:
if(x=1) p=100;
else P=10;
if (x==1) p=100;
else p-10;

Question 53.
What will be the output of the following code: int year; cin>>year;
if (year % 100==0) ,
if (year% 400==0)
cout<<“Leap”;
else
cout<<“Not Leap year”;

If the input given is (i) 2000 (ii) 2003 (iii) 2010?
(i) I/p: 2000
O/p: Leap

(ii) I/p: 2003
O/p: No output

(iii) I/p: 2010
O/p: No output

Question 54.
What is the output of the following code?
for(int i=2; i<=10; i+=2)
cout<<i;
output:
246810

Question 55.
Write a for loop that displays the number from 21 to 30.
for(int i=21; i<=30; i++)
cout<<i;

Question 56.
Write a while loop that displays numbers 2, 4 ,6, 8 ……20.
int i=2;
while(i<=20)
{
cout<<i<<“, i+=2 }

Question 57.
Compare an if and a? : operator
The conditional operator is an expression rather than a statement. There are few places the conditional operator can be used where an if/else cannot be used.

Question 58.
Convert the following if-else to a single conditional statement:
if (x>=10)
a=m +5;
else
a=m;
a=(x>=10) ?m+5:m;

Question 59.
Rewrite the following code so that it is functional:
v=5 .
do;
{
Total+=v;
Cout<<total;
while v<=10
int v=5, total=0;
do
{
total += v;
cout<<total;
v=v+1;
while(v<=10);

Question 60.
Write a C++ program to print multiplication table of a given number.
#include
using namespace std;
int main( )
{
int num;
cout<<“Enter number to find multiplication table”; cin>>num;
for(int a=1; a<=10; a++)
{
cout<<num<< ” + ” <<a<< ” = ” <<num*a<<endl;
}
return 0;
}
Output:
Enter number to find multiplication table 3
3 * 1 = 3
3 * 2 = 6
3 * 3 = 9
3 * 4 = 12
3 * 5 = 15
3 * 6 = 18
3 * 7 = 21
3 * 8 = 24
3 * 9 = 27
3 * 10 = 30
Press any key to continue

Question 61.
Write the syntax and purpose of switch statement.
Purpose: It provides an easy way to dispatch execution to different parts of code based on the value of the expression.
The syntax of the switch statement is;
switch(expression)
{
case constant 1:
statement(s);
break;
case constant 2:
statement(s)
break;
default
statement(s);
}

Question 62.
Write a short program to print following series:
(a) 1 4 7 10……40
#include
using namespace std;
int main( )
{
for(i=1;i<=40;i+=3)
cout<< i << ”
}
cout<<endl;
return 0;
}

Question 63.
Explain control statement with suitable example.
Control statements are statements that alter the sequence of flow of instructions.
Selection statement:

In a program, statements may be executed sequentially, selectively or iteratively. Every programming languages provides statements to support sequence, selection (branching) and iteration.

If the Statements are executed sequentially, the flow is called as sequential flow. In some situations, if the statements alter the flow of execution like branching, iteration, jumping and function calls, this flow is called as control flow.
Sequence statement:

The sequential statement are the statements, that are executed one after another only once from top to bottom: These statements do not alter the flow of execution. These statements are called as sequential flow statements. They always end with a semicolon (;).

The selection statement means the statement (s) are executed depending upon a condition. If a condition is true, a true block (a set of statements) is executed otherwise a false block is executed. This statement is also called decision statement or selection statement because it helps in making decision about which set of statements are to be executed.

Iteration statement:

The iteration statement is a set of statement that are repetitively executed depends upon a conditions. If a condition evaluates to true, the set of statements (true block) is executed again and again. As soon as the condition becomes false, the repetition stops. This is also known as looping statement or iteration statement. The set of statements that are executed again and again is called the body of the loop.The condition on which the execution or exit from the loop is called exit-condition or test- condition.

Question 64.
What is entry control loop? Explain any one of the entry loop with suitable example.
The loop which has a condition check at the entrance of the loop, the loop executes only and only if the condition is satisfied and is called as entry control loop.
Eg: (i) while loop (ii) for loop

while loop:
A while loop is a control flow statement that allows the loop statements to be executed as long as the condition is true. The while loop is an entry-controlled loop because the test-expression is evaluated before the entering into a loop.
The while loop syntax is:
while(Test expression)
{
Body of the loop;
}
Statement-x;
The control flow and flow chart of the while loop is shown below.

In while loop, the test expression is evaluated and if the test expression result is true, then the body of the loop is executed and again the control is transferred to the while loop. When the test expression result is false the control is transferred to statement-x.
#include
using namespace std;
int main( )
{
int i=i,sum=0;
while (i<=10)
{
sum=sum+i;
i++;
}
cout<<“The sum of 1 to 10 is”<<sum;
return 0;
}
Output:
The sum of 1 to 10 is 55

In the above program, the integer variable i is initialized to 1 and the variable sum to 0. The while loop checks the condition, i < 10, if the condition is true, the value of i, which is added to sum and i is incremented by 1. Again, the condition i < 10 is checked. Since 2 < 10, 2 is added to the earlier value of sum. This continues until i becomes 11. At this point in time, 11 < 10 evaluates to false and the while loop terminates. After the loop termination, the value of sum is displayed.

Question 65.
Write a program to find the LCM and GDC of two numbers.
#include
using namespace std;
int main( )
{
int a, b, x, y, t, gcd, 1 cm;
cout<<“Enter two Integers\n”; cin>>x>>y;
a=x; ‘
b=y;
while(b!=0)
{
t=b;
b=a%b;
a=t;
}
gcd=a;
1 cm=(x*y)/gcd
cout<<“Greatest common divisor of”<<x<< ” and “<<y<<” = ” <<gcd;
cout<<“Least common multiple of “<<x<<” and “<<y<<” >> ” << 1 cm;
return 0;
}
Output:
Enter two Integers
15
33
Greatest common divisor of 15 and 33=3
Least common multiple of 15 and 33=165

Question 66.
Write program to find the sum of following series:
(i) $$x-\frac{x^{2}}{2 !}+\frac{x^{3}}{3 !}-\frac{x^{4}}{4 !}+\frac{x^{5}}{5 !}-\frac{x^{6}}{6 !}$$

(ii) $$x+\frac{x^{2}}{2}+\frac{x^{3}}{3}+\ldots .+\frac{x^{n}}{n}$$
#include
#include using namespace std;
int main( )
{
int i,n,f=1;
float x, sum=0;
cout<<“\n Enter the value of x and n\n”; cin>>x>>n;
for(i=1;i<=n;i++)
{
f=f*i;
if (i%2==0)
{
sum -= pow (x, i) /f; }
else
{
sum += pow(x,i)/f;
}
}
cout<<“\n sum = “<<sum<<endl;
return 0;
}
Output:
Enter the. value of x and n : 2
6
sum = 0.844444

(ii)
#include .
#include using namespace std;
int main ( )
{
int i,n;
float x, sum=0;
cout<<“\n Enter the value of x and n:\n”; cin>>x>>n;
for (i=i;i<=n;i++)
{
sum+= pow(x,i)/i:
}
cout<<“\n Sum is =” <<sum<<endl;
return 0;
}
Output:
Enter the value of x and n:
2
6
sum is = 27.7333

Question 67.
Write a program to find sum of the series S = 1 + x + x2+ +xn
#include
#include using namespace std;
int main( )
{
long i, n, x, sum=1;
cout<<“\n Enter the value of x and n”; cin>>x>>n;
for(i=1;i<=n;i++)
{
sum += pow(x,i)
}
cout<<“\n sum”<<sum;
return 0;
}
Output:
Enter the value of x and n:
5
2
sum 31

Question 1.
There are _________ kinds of statements used in C++.
(a) two
(b) three
(c) four
(d) five
(a) two

Question 2.
A group of statements that are enclosed by pair of braces { } are called _______ statement.
(a) compound
(b) single
(c) null
(d) selection
(a) compound

Question 3.
_________ statements are statements that alter the sequence of flow of instructions.
(a) Sequential
(b) Control
(c) Iteration
(d) Selection
(b) Control

Question 4.
_________ statement are the statements, that are executed one after another only once from top to bottom.
(a) Control
(b) Compound
(c) Sequential
(d) Empty
(c) Sequential

Question 5.
The sequential flow statements ended with a
(a) .
(b) ;
(c) :
(d) ,
(b) ;

Question 6.
_________ statement are executed depends upon a condition.
(a) Iteration
(b) Selection
(c) Null
(d) Sequential
(b) Selection

Question 7.
The ________ statement is a set of statement are repetitively executed depends upon a Condition. .
(a) control
(b) null
(c) selection
(d) iteration
(d) iteration

Question 8.
Iteration statement are also known as _________ statement.
(a) branching
(b) looping
(c) control
(d) empty
(b) looping

Question 9.
The if statement that contains another if statement is called ______ statement.
(a) while
(b) for
(c) do
(d) nested statement.
(d) nested statement

Question 10.
__________ is a multi – path decision making statement.
(a) if statement
(b) if-else statement
(c) switch statement

Question 11.
The __________ operator is an alternate for ‘if else statement’.
(a) conditional
(b) assignment
(c) logical
(d) arithmetic
(a) conditional

Question 12.
Conditional operator takes __________ arguments.
(a) two
(b) four
(c) five
(d) three
(d) three

Question 13.
The conditional operate consists of ________ symbols.
(a) one
(b) two
(c) three
(d) five
(b) two

Question 14.
________ is a conditional operator.
(a) ::
(b) ;
(c) ?
(d) ?:
(d) ?:

Question 15.
________ statement is a multi-way branch statement.
(a) nested if
(b) switch
(d) if-else
(b) switch

Question 16.
__________ statement reduce the length of code and takes less memory space.
(a) Iteration
(b) Empty
(c) Selection
(d) Sequential
(a) Iteration

Question 17.
C++ supports _______ types of iteration statements.
(a) three
(b) four
(c) two
(d) six
(a) three

Question 18.
Every loop has elements.
(a) five
(b) six
(c) three
(d) four
(d) four

Question 19.
In _______ the control variables is initialized.
(a) initialization
(b) test expression
(c) update expression
(d) body of the loop
(a) initialization

Question 20.
________ decides whether the loop-body will be execute or not.
(a) Assignment expression
(b) Test expression
(c) Update expression
(d) Initialization expression
(b) Test expression

Question 21.
__________ expression change the value of the loop variables.
(a) Update
(b) Change
(c) Initialization
(d) Test
(a) Update

Question 22.
The ________ loop is the easiest looping statement which allows code to be executed repeatedly.
(a) while
(b) do-while
(c) for
(d) switch
(c) for

Question 23.
for loop contains __________ different statements.
(a) six
(b) five
(c) four
(d) three
(d) three

Question 24.
Initialization, condition and update expression are separated by:
(a) :
(b) ,
(c) ;
(d) .
(c) ;

Question 25.
The multiple initialization and multiple update expressions are separated by:
(a) commas
(b) full stop
(c) semicolon
(d) colon
(a) commas

Question 26.
_______ is an entry check loop.
(a) while
(b) do-while
(c) switch
(d) if
(a) while

Question 27.
The __________ loop is an exit-controlled loop.
(a) for
(b) if
(c) do-while
(d) while
(c) do-while

Question 28.
______ are used to interrupt the normal flow of program.
(a) Selection statement
(b) Sequential statement
(c) Control statement
(d) Jump statement
(d) Jump statement

Question 29.
There are _________ types of jump statement.
(a) four
(b) ffye
(c) three
(d) two
(c) three

Question 30.
The ________ statement is a control statement used to transfer the control without any condition.
(a) goto
(b) break
(c) continue
(d) switch
(a) goto

Question 31.
for (i = 1; i < 30; i++) how many times the loop will be executed:
(a) 1
(b) 29
(c) 30
(d) 31
(b) 29

Question 32.
if(a>b);
cout<<“greater”;
else
cout<<“lesser”;
What will be the error if thrown by the compiler from above statement:
(a) misplaced if
(b) misplaced else
(c) misplaced if.. .else
(d) misplaced else…if
(b) misplaced else

Question 33. __________ is used to terminate a statement sequence.
(a) case
(b) colon (:)
(c) break
(d) continue
(c) break

Question 34.
Identify the incorrect statement in switch case.
(a) Duplicate case values are not allowed
(b) The default statement is not optional
(c) The break statement is optional
(d) Nesting of switch statements is also allowed
(b) The default statement is not optional

Question 35.
________ loop is used in the above program.
(a) while
(b) for
(c) do-while
(d) switch
(c) do-while

Question 36.
An empty while loop does not have any statement inside the body of loop except:
(a) colon
(b) commas
(c) braces
(d) semicolon
(d) semicolon

Question 37.
In _________ loop the condition is evaluated at the bottom of the loop,
(a) for
(b) while
(c) switch
(d) do-while
(d) do-while

Question 38.
________ statement forces the loop to continue or execute the next iteration.
(a) break
(b) continue
(c) goto
(d) default
(b) continue

Question 39.
________ statement terminates the execution of the loop and resume normal execution after the body of the loop.
(a) if
(b) switch
(c) break
(d) continue
(c) break

Question 40.
Identify the invalid one:
(a) if (a > b)
(b) if (a<= b)
(c) if (a= =b)
(d) if a > b
(d) if a > b

Question 41.
Every action in the switch statement should be terminated with a ________ statement.
(a) case
(b) colon
(c) break
(d) continue
(c) break

Question 42.
An _____ loop will be formed if a test – expression is absent in a for loop.
(a) finite
(b) infinite
(c) empty
(d) continue
(b) infinite

Question 43.
When a loop has no statement in its body is called an:
(a) while loop
(b) empty loop
(c) finite loop
(d) infinite loop
(b) empty loop

Question 44.
In __________ loop the body of the loop is executed at least once even when the condition is false during first iteration.
(a) do-while
(b) for
(c) while
(d) switch
(a) do-while

Question 45.
Give the output cout<<5+10:
(a) 5+10
(b) 510
(c) 15
(d) 50
(c) 15

Question 46.
The loops are enclosed within:
(a) [ ]
(b) { }
(c) <>
(d) ##
(b) { }

Question 47.
From the given code below answer the questions from 47 to 50.
#include
using namespace std,
int main ( )
{
int num = 2
do
cout<<num*num;
num +=1;
}
while(num<6);
}
The control variable used in the program is:
(a) num
(b) +=1
(c) \t
(d) none
(a) num

Question 48.
The test expression in the program is:
(a) num
(b) num*num
(c) (num<6)
(d) +=1
(c) (num<6)

Question 49.
How many times the loop will be executed?
(a) 2
(b) 4
(c) 5
(d) 3
(b) 4

Question 50.
Match the following:

 (i) Null (a) ?: (ii) if else (b) Goto (iii) While loop (c) Empty (iv) Jump (d) Entry check

(a) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)
(b) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)
(c) (i) – (a); (ii) – (b); (iii) – (c); (iv) – (d)
(d) (i) – (c); (ii) – (a); (iii) – (d); (iv) – (b)
(d) (i) – (c); (ii) – (a); (iii) – (d); (iv) – (b)

Question 51.
Identify the correct statement:
(a) C++ allows a group of statements enclosed by pair Of [ ]
(b) The null statement is a statement containing a set of code.
(c) The sequential statement are the statement that are executed one after another only once from top to bottom.
(d) The iteration statement is a set of statement are not repetitively executed.
(c) The sequential statement are the statement that are executed one after another only once from top to bottom.

Question 52.
Identify the correct statement:
(a) A loop which contains another loop is called as nested loop.
(b) In do-while loop, the condition is evaluated at the top of the loop.
(c) Every loop has four elements that are used for different purpose.
(d) A switch statement can, only work for quality of comparisons.
(b) In do-while loop, the condition is evaluated at the top of the loop.

Question 53.
Choose the odd one out:
(a) for
(b) while
(c) do-while
(d) if-else
(d) if-else

Question 54.
Assertion (A):
The iteration statement is a set of statement are repetitively executed depends upon a condition.
Reason (R):
If a condition evaluates to true, the set of statements is executed again and again.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true, and R is the correct explanation for A.

Question 55.
What is the alternate name of null statement?
(a) No statement
(b) Empty statement
(c) Void statement
(d) Zero statement
(b) Empty statement

Question 56.
In C++, the group of statement should enclosed within:
(a) { }
(b) [ ]
(c) ( )
(d) <>
(a) { }

Question 57.
The set of statements that are executed again and again in iteration is called as:
(a) condition
(b) loop
(c) statement
(d) body of loop
(d) body of loop

Question 58.
The multi way branching statement:
(a) if
(b) if…else
(c) switch
(d) for
(c) switch

Question 59.
How many types of iteration statements?
(a) 2
(b) 3
(c) 4
(d) 5
(b) 3

Question 60.
How many times the following loop will execute? for (int i = 0;i < 10;i++)
(a) 0
(b) 10
(c) 9
(d) 11
(b) 10

Question 61.
Which of the following is the exit control loop?
(a) for
(b) while
(c) do…while
(d) if…else
(c) do…while

Question 62.
Identify the odd one from the keywords of jump statements:
(a) break
(b) switch
(c) goto
(d) continue
(b) switch

Question 63.
Which of the following is the exit control loop?
(a) do-while
(b) for
(c) while
(d) if-else
(a) do-while

Question 64.
A loop that contains another loop inside its body:
(a) Nested loop
(b) Inner loop
(c) Inline loop
(d) Nesting of loop
(a) Nested loop

## TN State Board 11th Computer Science Important Questions Chapter 9 Introduction to C++

Question 1.
What is character set?
Character set is a set of characters which are allowed to write a C++ program. C++ accepts the following characters.

Question 2.
What are identifiers? List the classification of C++operators.
C++ Operators are classified as:
(i) Arithmetic Operators
(ii) Relational Operators
(iii) Logical Operators

Question 3.
What are constants? List the types of constants in C++.
Literals are data items whose values do not change during the execution of a program.

Question 4.
What do you mean by Boolean literals?
Boolean literals are used to represent one of the Boolean values(True or false). True has value 1 and false has value 0.

Question 5.
How the operators are classified on the basis of the number of operands.

 Operators Operands Example Unary operators Require only one operands x++ Binary operators Require two operands c = a + b Ternary operators Require three operands max = (num 1 > num 2)? num1 : num2

Question 6.
List the charactreristics of C++ operators.
(i) Airthmetic Operators
(ii) Relational Operators
(iii) Logical Operators
(iv) Bitwise Operators
(v) Assignment Operators
(vi) Conditional Operator
(vii) Other Operators

Question 7.
What is get from operator?
C++ provides the operator >> to get input. It extracts the value through the keyboard and assigns it to the variable on its right; hence, it is called as “Stream extraction” or “get from”

Question 8.
What is put to operator?
C++ provides << operator to perform output operation. The operator « is called the “Stream insertion” or “put to” operator.

Question 9.
What are the two fundamental elements?
Every programming language has two fundamental elements, viz., data types and variables.

Question 10.
What is fundamental data type?
C++ provides a predefined set of data types for handling the data items. Such data types are known as fundamental or built-in data types.

Question 11.
What is user-defined data type?
Apart from the built-in data types, a programmer can also create his own data types called as User-defined data types.

Question 12.
Write the categories of C++.
In C++, the data types are classified as three main categories. They are:
(i) Fundamental data types
(ii) User-defined data types and
(iii) Derived data types.

Question 13.
Write the memory allocation for char data types.

Question 14.
Write the memory allocation for floating point data types.

Question 15.
What do you mean by number suffixes in C++?
Suffix can be used to assign the same value as a different type. For example, To store 45 in an int, long, unsigned int and unsigned long int, suffix letter L or U (either case) is used with 45 i.e., 45L or 45U. This type of declaration instructs the compiler to store the given values as long and unsigned. ‘F’ can be used for floating point values.
Eg: 3.14F.

Question 16.
Give the values associated with a symbolic variable.
There are two values associated with a symbolic variable; they are R-value and L-value.
(i) R-value is data stored in a memory location.
(ii) L-value is the memory address in which the R-value is stored.

Question 17.
What do you mean by initialization?
Assigning an initial value to a variable during its declaration is called as “Initialization”.
Eg:
int num =100;
float pi = 3.14;
double price = 231.45;

Question 18.
Name the members of iomanip header file.
The members of iomanip header file are setw, setfill, setprecision and setf manipulators.

Question 19.
List down the commonly used manipulators.
The commonly used manipulators are: endl, setw, setfill, setprecision and setf.

Question 20.
What is the use of setfill ( )?
setfill argument is used for filling the empty fields.
Syntax: setfill (character);
Eg: cout<< “\n H.R.A:” << setw(10) << setfill (0) << hra;

Question 21.
Name the types of conversion provided in C++.
(i) Implicit type conversion
(ii) Explicit type conversion

Question 22.
What do you mean by type promotion?
If the type of the operands differ, the compiler converts one of them to match with the other, using the rule that the “smaller” type is converted to the “wider” type, which is called as “Type Promotion”.

Question 23.
What is automatic conversion?
An Implicit type conversion is performed by the compiler automatically. So, implicit conversion is also called as “Automatic conversion”.

Question 24.
What is type casting?
Answer: C++ allows explicit conversion of variables or expressions from one data type to another specific data type by the programmer. It is called as “type casting”. Syntax: (type-name) expression;

Question 25.
List the benefits of C++.
(i) C++ is a highly portable language and is often the language of choice for multi-device, multi-platform app development.
(ii) It is an object-oriented programming language and includes classes, inheritance, polymorphism, data abstraction and encapsulation.
(iii) It has a rich function library.
(iv) It allows exception handling, inheritance and function overloading which are not possible in C.
(v) It is a powerful, efficient and fast language. It finds a wide range of applications – from GUI applications to 3D graphics for games to real-time mathematical simulations.

Question 26.
Write down the rules for naming an identifier.
(i) The first character of an identifier must be an alphabet or an underscore (_ ).
(ii) Only alphabets, digits and underscore are permitted. Other special characters are not allowed as part of an identifier.
(iii) C++ is case sensitive as it treats upper and lower-case characters differently.
(iv) Reserved words or keywords cannot be used as an identifier name.

Question 27.
Write short notes on string literals.
(i) Sequence of characters enclosed within double quotes are called as String literals.
(ii) By default, string literals are auto-matically added with a special character ‘\0’ (Null) at the end.
(iii) Therefore, the string “welcome” will actually be represented as “welcome\0” in memory and the size of this string is not 7 but 8 characters i.e., inclusive of the last character \0. Valid string Literals : “A”, “Welcome” “1234”. Invalid String Literals : ‘Welcome’, ‘1234’.

Question 28.
What do you mean by Bitwise one’s complirhent operator?
The bitwise One’s compliment operator -(Tilde), inverts all the bits in a binary pattern, i.e., all 1 ’s become 0 and all 0’s become 1. This is an unary operator. Eg: If a =15;
Equivalent binary values of a is 0000 1111

Question 29.
Write down the other operands in C++.

Question 30.
What do you mean by cascading of I/O operators?
Answer: The multiple use of input aryl output operators such as >> and << in a single statement is known as cascading of I/O operators.
cout<<“A=”<<Num; Cascading cin: Eg: cout>>”Enter two numberr
cin>>a>>b;

Question 31.
What is use of using namespace?
(i) The line using namespace std; tells the compiler to use standard namespace.
(ii) Namespace collects identifiers used for class, object and variables.
(iii) They provide a method of preventing name conflicts in large projects.

Question 32.
What is a variable? Write the syntax.
The variables are the named memory locations to hold values of specific data types.
Syntax: ;

Question 33.
Give short notes on data type modifiers in C++.
(i) Modifiers are used to modify the storing capacity of a fundamental data type except void type.
(ii) Every fundamental data type has a fixed range of values to store data items in memory.
(iii) For example, int data type can store only two bytes of data.
(iv) Modifiers can be used to modify (expand or reduce) the memory allocation of any fundamental data type. They are also called as Qualifiers.
There are four modifiers used in C++. They are:
(i) signed (ii) unsigned (iii) long (iv) short
These four modifiers can be used with any fundamental data type.

Question 34.
Write the memory allocation for integer data types.

Question 35.
Show the difference between Turbo C++ and Dev C++ for allocation of memory for the data types.

Question 36.
Write short notes on Junk or Garbage values.
If you declare a variable without any initial value, the memory space allocated to that variable will be occupied with some unknown value. These unknown values are called as “Junk” or “Garbage” values.
#include
using namespace std;
int main( )
{
int num1, num2, sum;
cout<<num1<<end1;
cout<<num2<,end1;
cout< }
In the above program, some unknown values will be occupied in memory that is allocated for the variables num1 and num2; and the statement court<

Question 37.
Explain dynamic initialization with example.
A variable can be initialized during the execution of a program. It is known as “Dynamic initialization”.
Eg:
int num1, num2, sum;
sum = num1 + num2;
C++ program to illustrate dynamic initialization:
#include
using namespace std;
int main( )
{
int num1, num2;
cout<<“\n Enter number 1:” ; cin>> numl;
cout<<“\n’Enter number 2:” ; cin>> num2;
int sum = num1 + num2;
// Dynamic initialization cout<<“\n Average:” << sum /2;
}
Output:
Enter number 1: 78
Enter number 2: 65
Average: 71

Question 38.
What is the use of endl? Give example.
endl – Inserts a new line and flushes the buffer (Flush means – clean)
‘\n’ – Inserts only a new line.
cout<<“\n The value of num =” «num;
cout<<“The value of num =” << num<<end;
Both these statements display the same output.

Question 39.
Write short note on setprecision( ).
setprecision( ) is used to display numbers with fractions in specific number of digits.
Syntax:
setprecision (number of digits);
Eg:
#include
#include
using namespace std;
int main( )
{
float hra = 1200.123;
cout< }
setprecision can also be used to set the number of decimal places to be displayed. To do this task, an ios flag is set within setf( ) manipulator. This may be used in two forms:
(i) fixed and
(ii) scientific.

Question 40.
What is an expression? Name the types of ’ expressions used in C++.
(i) An expression is a combination of operators, constants and variables arranged as per the rules of C++.
(ii) It may also include function calls which return values. (Functions will be learnt in upcoming chapters).
In C++, there are seven types of expressions, and they are:
(i) Constant Expression
(ii) Integer Expression
(iii) Floating Expression
(iv) Relational Expression
(v) Logical Expression
(vi) Bitwise Expression
(vii) Pointer Expression

Question 41.
Write a note on Implicit type conversion. Give example.
(i) An Implicit type conversion is performed by the compiler automatically.
(ii) So, implicit conversion is also called as ~ “Automatic conversion”.
Eg:
#include
using namespace std;
int main ( )
{
int a=6;
float b=3.14;
cout<<a+b;
}

In the above program, operand a is an int type and b is a float type. During the execution of the program, int is converted into a float, because a float is wider than int.

Question 42.
How the explicit conversion takes place? Give example.
Syntax:
(type-name) expression;
Where type-name is a valid C++ data type to which the conversion is to be performed.
Eg:
#include
using namespace std;
int main( )
{
float varf=78.685;
cout<<(int) varf;
}
In the above program, variable varf is declared as a float with an initial value 78.685. The value of varf is explicitly converted to an int type in cout statement. Thus, the final output will be 78.

Question 43.
What happens when you convert
(i) double to float,
(ii) float to int,
(iii) long to short.
(i) Double to float:
Loss of precision. If the original value is out of range for the target type, the result becomes undefined.

(ii) Float to int:
Loss of fractional part. If original value may be out of range for target type, the result becomes undefined.

(iii) Long to short:
Loss of data.

Question 44.
Explain the Escape sequences (or) non- graphical characters in C++.
(i) C++ allows certain non-printable characters represented as character constants. Non-printable characters are also called as non-graphical characters.
(ii) Non-printable characters cannot be typed directly from a keyboard during the execution of a program in C++, Eg: backspace, tabs etc.,

 Escape sequence Non graphical character \a Audible or alert bell \b Backspace \f Form feed \n Newline or linefeed \r Carriage return \t Horizontal tab \v Vertical tab \\ Backslash \’ Single quote \” Double quote \? Question Mark \On Octal number \xHn Hexadecimal number \0 Null

Question 45.
Name the familiar C++ compilers with IDE.
Dey C++
Geany
Code: :blocks
Code Lite
Net Beans
Digital Mars
Sky IDE
Eclipse

Question 46.
Write the syntax to declare more than one variable.
More than one variable of the same type can be declared as a single statement using a comma separating the individual variables.
Syntax:
, , , ………., ;
Eg:int num1, num2, sum;

Question 47.
Identify the Identifiers it is valid or invalid, if invalid give reason.

Question 48.
Explain the types of constants in detail.

Numeric Constants:
Numeric constants are further classified as
(i) Integer Constants (or) Fixed point constants.
(ii) Real constants (or) Floating point constants.

(i) Integer Constants (or) Fixed point constants:
Integers are whole numbers without any fractions. An integer constant must have at least one digit without a decimal point. In C++, there are three types of integer constants:
(a) Decimal,
(b) Octal,

(a) Decimal:
Any sequence of one or more digits (0 …. 9).

(b) Octal:
Any sequence of one or more octal values (0 …. 7) that begins with 0 is considered as an Octal constant.

Any sequence of one or more Hexadecimal values (0 …. 9, A …. F) that starts with Ox or OX is considered as an Hexadecimal constant.

The suffix L or l and U or u added with any constant forces that to be represented as a long or unsigned constant respectively.

(ii) Real Constants (or) Floating point constants:
It is a numeric constant having a fractional component. These constants may be written in fractional form or in exponent form. Fractional form of a real constant is a signed or unsigned sequence of digits including a decimal point between the digits. It must have at least one digit before and after a decimal point. It may have prefix with + or – sign. A real constant without any sign will be considered as positive.

Exponent form of real constants consists of two parts:
(1) Mantissa and
(2) Exponent.

The mantissa must be either an integer or a real constant. The mantissa followed by a letter E or e and the exponent. The exponent should also be an integer.
For example, 58000000.00 may be written as 0.58 × 108 or 0.58E8.

 Mantissa (Before E) Exponent (After E) 0.58 8

Eg:
5.864 E1 → 5.864 × 101 → 58.64
5864 E-2 → 5864 × 10-2 → 58.64
0.5864 E2 → 0.5864 × 102 → 58.64

Boolean Literals:
Boolean literals are used to represent one of the Boolean values(TrUe or false). Internally true has value 1 and false has value 0.

Character constant:
A character constant is any valid single character enclosed within single quote. A character constant in C++ must contain one character and must be enclosed within a single quote.
Valid character constants : ‘A’,‘2′, $’ Invalid character constants : “A” The value of a single character constant has an equivalent ASCII value. Eg: the value of ‘A’ is 65. String Literals: Sequence of characters enclosed within double quotes are called as String literals. By default, string literals are automatically added with a special character ‘\0’ (Null) at the end. Therefore, the string “welcome” will actually be represented as “welcome\0” in memory and the size of this string is not 7 but 8 characters i.e., inclusive of the last character \0. Valid String Literals: “A”, “Welcome” “1234”. Invalid String Literals: ‘Welcome’, ‘1234’. Question 49. List down the order of precedence in C++. Answer: Operators are executed in the order of precedence. The operands and the operators are grouped in a specific logical way for evaluation. This logical grouping is called as an Association. Question 50. What are punctuators? List down the punctuators use in C++. Answer: Punctuators are symbols, which are used as delimiters, while constructing a C++ program. They are also called as “Separators”. The following punctuators are used in C++; Question 51. Explain the basic elements of C++. Answer: 1. // C++ program to print a string (i) It is a comment statement. (ii) Any statement that begins with // are considered as comments. (iii) Compiler simply ignores the comment statement. (iv) If we need to write multiple lines of comments, we can use /* */. 2. # include (i) All C++ programs begin with include statements starting with a # (hash / pound). (ii) The symbol # is a directive for the preprocessor i.e., these statements are processed before . the compilation process begins. (iii) #include statement tells the compiler’s preprocessor to include the header file “iostream” in the program. (iv) iostream header file contains the definition of its member objects cin and cout. (v) If iostream is not included in program, an error message will occur on cin and cout. 3. using namespace std; (i) The line using namespace std; tells the compiler to use standard namespace. (ii) Namespace collects identifiers used for class, object and variables. (iii) They provide a method of preventing name conflicts in large projects. (iv) It is a new concept introduced by the ANSI C++ standards committee. 4. int main ( ) (i) C++ program is a collection of functions and every program must have a main function. (ii) The main( ) function is the starting point where all C++ programs begin their execution. (iii) The executable statements should be inside the main( ) function. The statements between the turly braces (Line number 5 to 8) are executable statements. Question 52. Explain the important steps for creating and executing a C++ program. Answer: The following four steps are followed for creating and executing a C++ program. (i) Creating Source code: Creating includes typing and editing the valid C++ code as per the rules followed by the C++ Compiler. (ii) Saving source code with extension .cpp: After typing, the source code should be saved with the extension .cpp (iii) Compilation: This is an important step in constructing a program. In compilation, compiler links the library files with the source code and verifies each and every line of code. (iv) Execution: This is the final step of construction of a C++ Program. In this stage, the object file becomes an executable file with extension .exe. Question 53. Explain the various formatting options available ¡n C++. Answer: The commonly used manipulators are endl, setw, setfill, setprecision and setf. (i) endl – Inserts a new line and flushes the buffer (Flush means – clean) (ii) ‘\n’ – Inserts only a new line. (iii) setw ( ): setw manipulator sets the width of the field assigned for the output. The field width determines the minimum number of characters to be written in output. Syntax: setw(number of characters) (iv) setfill ( ):This manipulator is usually used after setw. If the presented value does not entirely fil! the given width, then the specified character in the setfihl argument is used for filling the empty fields. Syntax: setfill (character); Eg: cout<<”\n H.R..A :“<<setw(10) < (v) setprecision ( ):This is used to display numbers with fractions in specific number of digits. Syntax: setprecision (number of digits); Question 54. Explain the different types of expression used in C++ with example. Answer: Question 55. Explain the types of conversion in detail. Answer: The process of converting one fundamental type into another is called as “Type Conversion”. C++ provides two types of conversions. (i) Implicit type conversion (ii) Explicit type conversion. (i) Implicit type conversion: This conversion is performed by the compiler automatically. So, implicit conversion is also called as “Automatic conversion”. If the type of the operands differ, the compiler converts “smaller” type to “wider” type which is called “type promotion”. Eg: #include using namespace std; int main( ) { int a=6; float b=3.14; cout<< a+b; } In the above program, operand a is an int type and b is a float type. During the execution of the program, int is converted into a float, because a float is wider than int. (ii) Explicit type conversion: It is used to convert from one data type to another specific data type by the programmer. It is called as “type casting”. Syntax: (type-name) expression; Where type-name is a valid C++ data type to which the conversion is to be performed. Eg: #include using namespace std; int main( ) { float varf=78.685; cout<<(int) varf; In the above program, variable varf is declared as a float with an initial value 78.685. The value of varf is explicitly converted to an mt type in cout statement. Thus, the final output will be 78. Question 56. Write C++ programs to interchange the values of two variables. (i) Using with third variable (ii) Using without third variable Answer: (i) Using with third variable. #include using namespace std; int main ( ) int a,b,temp; cout<<“\n Enter 1st number:”; cin>>a; cout<<“\n Enter 2nd number:”; cin>>b; cout<<“Before swapping: First number: “<<a<<“Second number :”<<b; temp a; a = b; b = temp; cout<<“\n After swapping: First number: “<<a<<“Second number: “<<b; return 0; } Output: Enter 1st number : 20 Enter 2nd number: 50 Before swapping: First number : 20 second number: 50 After swapping: First number : 50 second number: 20 (ii) Using without third variable: #inciude using namespace std; int, main ( ) { int a,b; cout<<“\n Enter two numbers:”; cin>>a>>b; . a = a+b; . b = a-b; a = a-b; cout<<“\n After swapping numbers are:”; cout<<a<<” “<<b; return 0; } Output: Enter 1st number : 90 Enter. 2nd number: 100 Before swapping: First number: 90 second number: 100 After, swapping: First number:100 second number: 90 Question 57. Write C++ program to do the following: (i) To find the perimeter and area of a quadrant. (ii) To find the area of triangle. (iii) To convert the temperature from Celsius to Fahrenheit. Answer: (i) Perimeter = 0.57πr + 2r Area = πr2 ÷ 4 Program: #include using namespace std; int main( ) { float Peri, Area, r; eout<<“Enter the value of r:”; cin>>r; Peri = 0.5*3.14*r+2*r; Area = 3.14*r*r/4; cout<<“The perimeter of a , quadrant: “<<peri; cout<<“\n The area of a quadrant: “<<area; return 0; } Output: Enter the value of r: 7 The perimeter of a quadrant: 24.99 The area of a quadrant: 38.465 (ii) (area – sqrt(s*(s-a)*(s-b)*(s-c)) Where s= (a+b+c)/2 Program: #include #include using namespace std; int main( ) { float a,b, c, s, area; cout<<“Enter three sides of a triangle:”; cin>>a>>b>>c; s=(a+b+c)/2 area = sqrt(s*((s-a)*(s-b)*(s-c)); cout<<“Area of triangle is:”<<area; return 0; } Output: Enter three sides of a triangle:5 8 10 Area of triangle is 19.81 (iii) Program: #include using namespace std; int main( ) { float f,c; cout<<“Enter the temperature in celsius\n”; cin>>c; f = (9.a/5.0)*c+32 cout<<c<<“centigrade is equal to”<<f<<“fahrenheit”; return 0; } Output: Enter the temperature in celsius 36 36 centigrade is equal to 96.8 Fahrenheit Question 58. Write a C++ to find the total and percentage of marks you secured Irani 10th Standard Public Exam. Display all the marks one-by- one along with total and percentage. Apply formatting functions. Answer: #include #include using namespacestd; int main( ) { int m1, m2, m3, m4, m5, tot; float per; char name[30]; . cout<<“\n Enter Name:”; cin»name; cout<<“\n Enter Tamil Mark:”; cin>>m1; cout<<“\n Enter English Mark:”; cin>>m2; cout<<“\n Enter Maths Mark:”; cin>>m3; cout<<“\n Enter Science Mark:”; cin>>m4; cout<<“\n Enter Social science Mark:”; cin>>m5; Tot = m1 + m2 + m3 + m4 + m5; Per = tot/5; cout< setw(10)<< name<<endl: cout< setw (10) <<ml«endl ; cout«setw (25)<<“English:” setw (10)<<m2<<endl; cout< setw(10)<<m3< cout<<setw(25)<<“Science:” setw(10)<<m4<<endl; cout< setw (10)<<m5< cout«setw (25)<<“Total: ” setw (10) <<tot<<endl; cout< setw(10)<<per<<endl; } Output: Enter Name : Kavitha Enter Tamil Mark : 90 Enter English Mark : 86 Enter Maths Mark : 100 Enter Science Mark : 91 Enter Social science Mark: 87 Name : Kavitha Tamil : 90 English : 86 Maths : 100 Science : 91 Social science : 87 Total : 454 Percentage : 90.8 Question 59. What is meant by literals? How many types of integer literals available in C++? Answer: Literals are data items whose values do not change during the execution of a program. There are three types of integer literals available in C++. (i) Decimal (ii) Octal (iii) Hexadecimal. Question 60. What kind of constants are following? (i) 26 (ii) 015 (iii) OxF (iv) 014.9 Answer: (i) 26 = Integer constant (ii) 015 = Octal constant (iii) OxF = Hexadecimal constant (iv) 014.9 = Decimal constant Question 61. What is character constant in C++? Answer: Any valid single character enclosed within single quotes is called a character constant. In C++, a character constant must contain one character and must be enclosed within a single quote. Valid character constants: ‘A’, ‘2’, *$’
Invalid character constants : “A”

Question 62.
How are non-graphic characters represented in C++?
The non-graphical characters are represented are using escape sequences. An escape sequence is represented by a backslash followed by one or two characters.
Eg: \a, \b, \f, \0, \On

Question 63.
Write the following real constants into exponent form:
(i) 32.179
(ii) 8.124
(iii) 0.00007
(i) 32.179 = 0.32179 × 102 = 0.32179E2
(ii) 8.124 = 0.8124 × 101 = 0.8124E1
(iii) 0.00007 = 0.7 × 10-4 = 0.7E – 4

Question 64.
Write the following real constants into fractional form:
(i) 0.23E4
(ii) 0.517E – 3
(iii) 0.5E – 5
(i) 0.23E4 = 0.23 × 104 = 2300.0
(ii) 0.517E – 3 = 0.517 × 10-3 = 0.000517
(iii) 0.5E – 5 = 0.5 × 10-5 = 0.000005

Question 65.
What is the significance of null (\0) character in a string?
By default, string literals are automatically added with a special character ‘\0’ (Null) at the end.

Question 66.
What is use of operators?
The symbols which are used to do mathematical or logical operations are called as “Operators”; The data items or values that the operators act upon are called as “Operands”.

Question 67.
What are binary operators? Give examples arithmetic binary operators.
Operators that required two operands are called binary operators.
Arithmetic operators perform simple arithmetic operations like addition, subtraction, multiplication, division etc.,

Question 68.
What does the modulus operator % do?
Modulus operator is used to find the remainder of a division.
Eg: 10%3 = 1 (remainder of the division)

Question 69.
What will be the result of 8.5 % 2?
0.

Question 70.
Assume that R starts with value 35. What will be the value of S from the following expression? S – (R- -)+(++R)
R = 35
S = 35+36
S = 71

Question 71.
What will be the value of j = – k + 2k. if k is 20 initially ?
k = 20, –k = k – 1 = 20 – 1 = 19
j = –k+2k, Now k = 19
= 19 + 2*19
= 19 + 38
= -57

Question 72.
What will be the value of p = p * ++j where j is 22 and p = 3 initially?
p = p*++j
p = 3*23
p = 69

Question 73.
Give that i = 8, j = 10, k = 8, What will be result of the following expressions?
(i) i < k
(ii) i < j
(iii) i > = k
(iv) i = = j
(v) j I = k
(i) i < k = 0
(ii) i < j = 1
(iii) i >= k = 1
(iv) i = = j = 0
(v) j! = k = 1
[Hint ∵ 0 (false) 1 (true)]

Question 74.
What will be the order of evaluation for the following expressions?
(i) i + 3 >= j – 9
(ii) a +10 < p – 3 + 2q
(i) Step 1: i + 3
Step 2: j – 9
Step 3: i + 3 >= j – 9

(ii) Step 1: 2q
Step 2: a+10
Step 3: p – 3
Step 4: a + 10 < p – 3 + 2q

Question 75.
Write an expression involving a logical operator to test, if marks are 75 and grade is ‘A’.
((Mark >= 75) &&(grade = = ‘A’))

Question 76.
What do you mean by fundamental data types?
The predefined data types available with C++ are called the Fundamental (atomic) data types. There are five fundamental data types in C++: char, int, float, double and void.

Question 77.
The data type char is used to represent characters, then why is it often termed as an integer type?
(i) All the characters are represented in memory by the associated as ASCII codes. So character data type is often said to be an integer type.
(ii) If a variable is declared as char, C++ allows storing either a character or an integer value.

Question 78.
What is the advantage of floating point numbers over integers?
(i) They can represent values between the integers.
(ii) They can represent a much greater range of values.

Question 79.
The data type double is another floating point type. Then why is it treated as a distinct data type?
The double data type is for double precision floating point numbers, (precision means significant numbers after decimal point). The double is also used for handling floating point numbers. But, this type occupies double the space than float type. This means, more fractions can be accommodated in double than in float type. The double is larger and slower than type float. The double is used in a similar way as that of float data type.

Question 80.
What is the use of void data type?
The literal meaning for void is ‘empty space’.
(i) In C++, the void data type specifies an empty set of values.
(ii) It is used as a return type for functions that do not return any value.

Question 81.
What is meant by type conversion?
The process of converting one fundamental type into another is called as “Type Conversion”.

Question 82.
How implicit conversion different from explicit conversion?
Implicit type conversion is a conversion performed by the compiler automatically, where as explicit conversion is done by programmer.

Question 83.
What is difference between endl and \n?
endl – Inserts a new line and flushes the buffer.
\n – Inserts only a new line.

Question 84.
What is the use of references?
A reference provides an alias for a previously defined variable. Declaration of a reference consists of base type and an & (ampersand) symbol; reference variable name is assigned value of a previously declared variable.
Syntax: <& reference_variable> =

Question 85.
What is the use of setprecision ( ) ?
It is used to display numbers with fractions in specific number of digits.
Syntax: setprecision (number of digits);

Question 86.
What is meant by a token? Name the token available in C++.
The smallest individual unit in a program is known as a token or a lexical unit. The tokens are available in C++ are:
(i) Keywords
(ii) Literals
(iii) Punctuators
(iv) Identifiers
(v) Operators.

Question 87.
What are keywords? Can keywords be used as identifiers?
Keywords are the reserved words which convey specific meaning to the C++ compiler. No, keywords cannot be used as identifiers.

Question 88.
The following constants are of which type?
(i) 39
(ii) 032
(iii) OXCAFE
(iv) 04.14
(i) 39 = Integer
(ii) 032 = Octal
(iv) 04.14 = Decimal

Question 89.
Write the following real constants into the exponent form:
(i) 23.197
(ii) 7.214
(iii) 0.00005
(iv) 0.319
(i) 23.197 = 0.23197 × 102 = 0.23197E2
(ii) 7.214 = 0.7214 × 101 = 0.7214E1
(iii) 0.00005 = 0.5 × 104 = 0.5E – 4
(iv) 0.319 – 0.0319 × 101 = 0.0319E1.

Question 90.
Assume n = 10; what will be result of n>>2;?
The equivalent binary value of 10 is (00001010)2

n>>2 = (00000010)2 = (2)10

Question 6.
Match the following:

 A B (i) Modulus (a) Tokens (ii) Separators (b) Remainder of a division (iii) Stream extraction (c) Punctuators (iv) Lexical units (d) get form

(i) – (b)
(ii) – (c)
(iii) – (d)
(iv) – (a)

Question 91.
Describe the differences between keywords and identifiers?

 Keywords Identifiers Keywords are the reserved words which convey specific meaning to the C++ complier. Identifiers are the user – defined names given to different parts,vof the C++ program. They are essential elements to construct C++ program. These are the fundamental building blocks of a program. Eg: Auto, break, class etc., Eg: total- sales

Question 92.
Is C++ case sensitive? What is meant by the term “case sensitive”?
Yes, C++ is a case sensitive. So all the keywords must be in lower case. It treats upper and lower case characters differently. Eg: int, break, auto etc.

Question 93.
Differentiate “=” and “== “.

 = == It is an assignment operator. It is an equal to operator. It is used to assign the value of variable or expression which is on the left hand side of an assignment statement. It is used to compare value of both left and right operands. Eg: A = 32 Eg: a = = b

Question 94.
Assume a = 10, b = 15; What will be the value of a^b?
a = 10 binary equivalent = (00001010)2
b = 15 binary equivalent = (00001111)2

(a^b) = (00000101)2 = (5)10

Question 95.
What is the difference between “Run time error” and “Syntax error”?

 Runtime Error Syntax Error A mntime error is that occurs during the execution of a program. It occurs because of some illegal operation that take place. Syntax error occurs when grammatical values of C++ are violated. Eg: If a program tries to Open a file which does not exit, it results in a run time error Eg: cout<< “welcome to programming in C++”. As per grammatical rules of C++, every executable statement should terminate with a semicolon, but this statement does not end with a semicolon. So, C++ will throw an error.

Question 96.
What are the differences between “Logical error” and “Syntax error”?

 Logical error Syntax error A Program has not produced expected result even though the program is grammatically correct. Syntax errors occur when grammatical rules of C++ are violated. It may be happened by wrong use of variable / operator / order of execution etc., Eg: If you type as follows, C++ will throw an error. cout<< “Welcome to Programming in C++”. This means, program is grammatically correct, but it contains some logical error. So, Semantic error is also called as “Logic Error”. As per grammatical rules of C++, every executable statement should terminate with a semicolon. But, this statement does not end with a semicolon.

Question 97.
Write about Binary Operators used in C++.
(i) Arithmetic operators: Arithmetic operators perform simple arithmetic operations like addition, subtraction, multiplication, division etc.,

The above mentioned arithmetic operators are binary operators which requires minimum of two operands.

(ii) Relational Operators:
• Relational operators are used to determine the relationship between its operands.
• When the relational operators are applied on two operands, the result will be a Boolean value
i. e., 1 or 0 to represents True or False respectively. C++ provides six relational operators.
They are,

• In the above examples, the operand a is compared with b and depending on the relation, the result will be either 1 or 0. i.e., 1 for true, 0 for false.
• All six relational operators are binary operators.

(iii) Logical Operators:
• A logical operator is used to evaluate logical and relational expressions.
• The logical operators act upon the operands that are themselves called as logical expressions. C++ provides three logical operators.

(iv) Bitwise Operators:
Bitwise operators work on each bit of data and perform bit-by-bit operation. In C++, there are,.three kinds of bitwise operators, which are:
(a) Logical bitwise operators
(b) Bitwise shift operators
(c) One’s compliment operators

(a) Logical bitwise operators:

 & Bitwise AND (Binary AND) 1 Bitwise OR (Binary OR) A Bitwise Exclusive OR (Binary XOR)

• Bitwise AND (&) will return 1 (True) if both the operands are having the value 1 (True); Otherwise, it will return 0 (False)
• Bitwise OR (|) will return 1 (True) if any one of the operands is having a value 1 (True); It returns 0 (False) if both the operands are having the value 0 (False)
• Bitwise XOR (^) will return 1 (True) if only one of the operand is having a value 1 (True).If both are True or both are False, it will return 0 (False).
Truth table for bitwise operators (AND, OR, XOR)

Eg:
If a = 65, b = 15
Equivalent binary values of 65 = 0100 0001; 15 = 0000 1111

(b) The Bitwise shift operators:
There ate two bitwise shift operators in C++, Shift left (<<) and Shift right (>>).
• Shift left (<<) – The value of the left operand is moved to left by the number of bits specified by the right operand. Right operand should be an unsigned integer. • Shift right (>>) – The value of the left operand is moved to right by the number of bits specified by the right operand. Right operand should be an unsigned integer.
Eg:
If a = 15; Equivalent binary value of a is 0000 1111

(v) Assignment Operators:
• Assignment operator is used to assign a value to a variable which is on the left hand side of an assignment statement.
• = (equal to) is commonly used as the assignment operator in all computer programming languages.
• This operator copies the value at the right side of the operator to the left side variable. It is also a binary operator.

C++ uses different types of assignment operators. They are called as Shorthand assignment operators.

Question 98.
What are the types of Errors?

Question 99.
Assume a=15, b=20; What will be the result of the following operations?
(a) a&b,
(b) a | b,
(c) a^b,
(d) a>>3,
(e) (~b)
The binary equivalent of 15 is 00001111
The binary equivalent of 20 is 00010100

a&b = (00000100)2 = (4)10
a|b = (00011111)2 = (31)10
a^b = (00011011)2 = (27)10
a>>3 = (00000001)2 = (1)10
(~b) = (11101011)2 = (-21)10

Question 100.
Write a short note on const keyword with an example.
const is the keyword used to declare a constant, const keyword modifies / restricts the accessibility of a variable. So, it is known as Access modifier.
Eg:
int num =100;

Question 101.
What is the use of setw( ) format manipulator?
setw manipulator sets the width of the field assigned for the output. The field width determines the minimum number of characters to be written in output.
Syntax: setw(number of characters)

Question 102.
Why is char often treated as integer data type?
Character data type is often said to be an integer type, since all the characters are represented in memory by their associated ASCII Codes. If a variable is declared as char, C++ allows storing either a character or an integer value.

Question 103.
What is a reference variable? What is its use?
A reference provides an alias for a previously defined variable. Declaration of a reference consists of base type and an & (ampersand) symbol; reference variable name is assigned the value of a previously declared variable.
Syntax:
<& reference_variable> =

Question 104.
Consider the following C++ statement. Are they equivalent?
char ch = 67;
char ch = ‘C’;
Yes, they are equivalent.

Question 105.
What is the difference between 56L and 56?
56L instructs the compiler to store the given value as long and unsigned int.
56 stores the value in an int.

Question 106.
Determine which of the following are valid constant? And specify their type.
(i) 0.5
(ii) ‘Name’
(iii) ‘\t’
(iv) 27,822

Question 107.
Suppose x and y are two double type variable that you want add as integer and assign to an integer variable. Construct a C++ statement for the doing so.
double x,y;
int z = (int)x + int(y)

Question 108.
What will be the result of following if num = 6 initially.
(a) cout << num;
(b) cout <<(num==5); Output: (a) 6 (b) 0

Question 109.
Which of the following two statements are valid? Why? Also write their result.
int a;
(i) a = 3,014;
(ii) a=(3,014);
(i) a = 3,014; Invalid
(ii) a = (3,014); Valid.

Question 110.
What are arithmetic operators in C++? Differentiate unary and binary arithmetic operators. Give example for each of them.
Arithmetic operators perform simple arithmetic operations like addition, subtraction, multiplication, division etc.,

The above mentioned arithmetic operators are binary operators which requires minimum of two operands.

Question 111.
Evaluate x+= x + ++x; Let x=5;
++x =x+1 =5+1=6 x =6 x+ = 6+6 x+=12 x =x+12 =6+12=18 x = 18

Question 112.
How relational operators and logical operators related to one another?
Relational operators are used to determine the relationship between its operands and produce the Boolean result. Logical operators are used to combine the results of two or more comparison expressions that use relational operators. Logical operators don’t compare values they combine Boolean values and produce a Boolean result. Logical operators are: && (and), ||(or), !(not)

Question 113.
Evaluate the following C++ expressions where x, y, z are integers and m, n are floating point numbers. The value of x = 5, y = 4 and m=2.5;
(i) n = x + y / x;
(ii) z = m * x + y;
(iii)z= (x++) * m+x;
(i) n = x+y/x; N = 5+4/5 N = 5+0 (the / symbol gives only the quotient) N = 5
(ii) z = m*x+y = 2.5*5+4 = 12.5+4 = 16.5 Z = 16 (z is declared as integer data type it ignores the fractional part)
(iii) z = (x++)*m+x; = 5 * 2.5+5 = 12.5+5 = 17.5 Z 17 (z is declared as integer data type it takes the integer part and ignores the fractional part).

Question 1.
C++ was developed by:
(a) Charles Babbage
(b) Bjame Stroustrup
(c) Bill Gates
(d) Sundar Pichai
(b) Bjame Stroustrup

Question 2.
C++ was developed in the year:
(a) 1960
(b) 1979
(c) 1985
(d) 1963
(b) 1979

Question 3.
C++ supports both:
(a) procedural language
(b) object oriented programming
(c) both (a) and (b)
(d) none
(c) both (a) and (b)

Question 4.
The name C++ was coined by:
(a) Rick Maseitti
(b) Charles Babbage
(c) Bill Gates
(d) Dennis Ritchie
(a) Rick Maseitti

Question 5.
C++ was developed in Laboratory.
(a) T laboratory
(b) AT laboratory
(c) AT & T Bell laboratory
(d) None of the above
(c) AT & T Bell laboratory

Question 6.
In ______ the name was change as C++ by Rick Maseitti.
(a) 1983
(b) 1966
(c) 1989
(d) 1994
(a) 1983

Question 7.
The latest standard version published in December 2017 as:
(a) ISO/ICE 14882:2017
(b) ISO/ICE 14883:2017
(c) ISO/ICE 14885:2017
(d) ICE/ISO 14882:2017
(a) ISO/ICE 14882:2017

Question 8.
The first standardized version was published in the year:
(a) 1999
(b) 1986
(c) 1970
(d) 1998
(d) 1998

Question 9.
_________ is a set of characters which are allowed to write a C++ program.
(a) character set
(b) number set
(c) symbols
(d) special characters
(a) character set

Question 10.
The smallest individual unit in a program is known as:
(a) character set
(b) symbols
(c) token
(d) keywords
(c) token

Question 11.
_________ is also called as token.
(a) Logical element
(b) Lexical unit
(c) Logical units
(d) symbols
(b) Lexical unit

Question 12.
__________ are the reserved works which convey specific meaning to the C++ compiler.
(a) Tokens
(b) Identifiers
(c) Constants
(d) Keywords
(d) Keywords

Question 13.
C++is:
(a) package
(b) software
(c) case sensitive
(d) non-case sensitive
(c) case sensitive

Question 14.
Identify the invalid variable name:
(a) Num
(b) Num2
(d) 2 myfile
(d) 2 myfile

Question 15.
__________ are data items whose values do not change during the execution of program.
(a) Literals
(b) This
(c) Identifiers
(d) Special characters
(a) Literals

Question 16.
Literals are also called as:
(a) identifiers
(b) character set
(c) constants
(d) string
(c) constants

Question 17.
______ are whole numbers without any fraction.
(a) String
(b) Integers
(c) Decimal
(d) Keywords
(b) Integers

Question 18.
In C++ there are _____ types of integer constants.
(a) two
(b) four
(c) five
(d) three
(d) three

Question 19.
Identify the Invalid decimal:
(a) 725
(b) -2T
(c) 4.56
(d) 7,500
(d) 7,500

Question 20.
Any sequence of one or more octal values that begins with 0 is considered as an ________ constant.
(a) decimal
(b) octal
(c) binary
(b) octal

Question 21.
Identify the invalid octal constant:
(a) 012
(b) -027
(c) +0231
(d) 0158
(d) 0158

Question 22.
Any sequence of one or more values that starts with ox or OX is considered as:
(a) octal
(b) binary
(d) decimal

Question 23.
The suffix ________ added with any constant forces that to be represented as long constant.
(a) L or l
(b) I or i
(c) O or o
(d) X or x
(a) L or l

Question 24.
The suffix _____ added with any constant forces that to be represented as unsigned constant respectively.
(a) U or u
(b) L or l
(c) O or o
(d) I or i
(a) U or u

Question 25.
Exponent form of real constant consists of a parts.
(a) 1
(b) 2
(c) 3
(d) 4
(b) 2

Question 26.
Identify the invalid character constants:
(a) ‘A’
(b) ‘2’
(c) ‘$’ (d) “A” Answer: (d) “A” Question 27. ASCII was first developed and published in: (a) 1964 (b) 1963 (c) 1965 (d) 1970 Answer: (b) 1963 Question 28. An escape sequence is represented by __________ followed by one or two characters. (a) double quotes (b) single quote (c) backslash (d) forward slash Answer: (c) backslash Question 29. \t is a: (a) vertical tab (b) backslash (c) backspace (d) horizontal tab Answer: (d) horizontal tab Question 30. \r is a: (a) alert bell (b) form feed (c) carriage return (d) backslash Answer: (c) carriage return Question 31. \n is a: (a) new line (b) carriage return (c) form feed (d) horizontal tab Answer: (a) new line Question 32. String literals are automatically added with a special character _________ at the end. (a) ‘\0’ (b) ‘\n’ (c) ‘\f (d) ‘\v’ Answer: (a) ‘\0’ Question 33. Identify the valid string literals: (a) ‘welcome’ (b) ‘A’ (c) ‘1234’ (d) “welcome” Answer: (d) “welcome” Question 34. The symbols which are used to do some mathematical or logical operations are called as: (a) operands (b) operators (c) constants (d) identifiers Answer: (b) operators Question 35. The data items or values that the operators act upon are called as: (a) operands (b) literals (c) operators (d) identifiers Answer: (a) operands Question 36. Unary operator requires operand. (a) one (b) two (c) three (d) four Answer: (a) one Question 37. Binary operator requires ______ operand. (a) one (b) two (c) three (d) four Answer: (b) two Question 38. Ternary operator requires _______ operand. (a) one (b) two (c) three (d) four Answer: (c) three Question 39. If N1 = 10 and N2 = 20. Find the value of S where S = N1+++++N2. – (a) 30 (b) 29 (c) 32 (d) 31 Answer: (d) 31\ Question 40. In C++ there are _______ types of bitwise operators. (a) 2 (b) 4 (c) 5 (d) 3 Answer: (d) 3 Question 41. There are ________ bitwise shift operators in C++. (a) 2 (b) 3 (c) 4 (d) 6 Answer: (a) 2 Question 42. _______ operator is used to assign a value to a variable. (a) Bitwise (b) Logical (c) Assignment (d) Arithmetic Answer: (c) Assignment Question 43. In C++ conditional operator is also called as operator. (a) Unary (b) Binary (c) Ternary (d) Logical Answer: (c) Ternary Question 44. _______ is a conditional operator. (a) : : (b) * (c) & (d) ?: Answer: (d) ?: Question 45. _________ is a address of operator. (a) → (b) & (c) →* (d) * Answer: (b) & Question 46. ______ is used for multiplication as well as for pointer to a variable. (a) :: (b) * (c) & (d) ?: Answer: (b) * Question 47. _______ are also called as separators. (a) Punctuators (b) Strings (c) Constants (d) Identifiers Answer: (a) Punctuators Question 48. ______ are symbols, which are used as delimiters, while constructing a C++ program. (a) Logical operators (b) Binary operators (c) Punctuators (d) Arithmetic operators Answer: (c) Punctuators Question 49. C++ provides the ________ operator to get input. (a) >> (b) << (c) > (d) < Answer: (a) >> Question 50. The >> operator called as: (a) Stream extraction (b) Stream insertion (c) Input operator (d) Output operator Answer: (a) Stream extraction Question 51. Stream extraction operator is also called as _______ operator. (a) put to (b) get form (c) set form (d) set into Answer: (b) get form Question 52. C++ provides __________ operator to perform in output operation. (a) << (b) >> (c) < (d) > Answer: (a) << Question 53. The operator << is called the ______ operator. (a) Stream insertion (b) Stream extraction (c) Expression (d) Ternary Answer: (a) Stream insertion Question 54. // are considered as ________ statements. (a) comment (b) executable (c) printable (d) preprocessor Answer: (a) comment Question 55. The symbol _________ is a directive for the preprocessor. (a)$
(b) &
(c) ::
(d) #
(d) #

Question 56.
______ provide a method of preventing name conflicts in large projects.
(a) iostream
(b) name space
(c) main ( )
(d) int
(b) name space

Question 57.
The executable statements should be inside the _________ function.
(a) namespace
(b) size of
(c) int ( )
(d) main ( )
(d) main ( )

Question 58.
The object file has an extension:
(a) .ojb
(b) .ocb
(c) .obj
(d) .obf
(c) .obj

Question 59.
______ makes it easy to create, compile and execute a C++ program.
(a) GUI
(b) Command prompt
(c) Operating system
(d) IDE
(d) IDE

Question 60.
To create a source file ______ is used.
(a) Ctrl + N
(b) Ctrl + P
(c) Shift + N
(d) Shift + ctrl + N
(a) Ctrl + N

Question 61.
______ occur when grammatical rules of C++ are violated.
(a) Syntax errors
(b) Semantic errors
(c) Run-time errors
(d) Logical errors
(a) Syntax errors

Question 62.
_________ error occurs when the program is grammatically correct, but it contains some logical error.
(a) Lexical
(b) Syntax
(c) Semantic
(d) Run-time
(c) Semantic

Question 63. Every programming language has __________ fundamental elements.
(a) 3
(b) 2
(c) 4
(d) 5
(b) 2

Question 64.
In a programming language, fields are referred as:
(a) data
(b) records
(c) objects
(d) variables
(d) variables

Question 65.
Values are referred to as:
(a) objects
(b) classes
(c) data
(d) variables
(c) data

Question 66.
In C++ the data types are classified as __________ main categories.
(a) four
(b) three
(c) six
(d) five
(b) three

Question 67.
The _________ are the named memory locations to hold values of specific data types.
(a) objects
(b) functions
(c) variables
(d) class
(c) variables

Question 68.
________ data types are predefined data types available with C++.
(a) basic
(b) fundamental
(c) derived
(d) user – defined
(b) fundamental

Question 69.
There are _________ fundamentals data types in C++.
(a) three
(b) four
(c) five
(d) six
(c) five

Question 70.
The literal meaning for void is:
(a) half space
(b) empty space
(c) no space
(d) none of these
(b) empty space

Question 71.
int data type has ____ bytes.
(a) 1
(b) 2
(c) 3
(d) 8
(b) 2

Question 72.
double data type has _______ bytes.
(a) 1
(b) 2
(c) 4
(d) 8
(d) 8

Question 73.
char data type has _______ bytes.
(a) 1
(b) 2
(c) 5
(d) 8

Question 74.
float data type has ____ bytes.
(a) 4
(b) 3
(c) 2
(d) 8
(a) 4

Question 75.
__________ can be used to modify the memory allocation of any fundamental data type.
(a) variables
(b) modifiers
(c) data type
(d) objects
(b) modifiers

Question 76.
Modifiers are also called as:
(a) qualifiers
(b) variables
(c) constants
(d) functions
(a) qualifiers

Question 77.
There are ________ modifiers used in C++.
(a) three
(b) six
(c) four
(d) five
(c) four

Question 78.
short int has the value range from:
(a) -32,768 to 32,767
(b) 32,767 to -32,768
(c) -32,678 to 33,676
(d) 32,678 to 33,676
(a) -32,768 to 32,767

Question 79.
long double has __________ bytes space in memory.
(a) 5
(b) 11
(c) 10
(d) 12
(c) 10

Question 80.
1 byte = ______ bits.
(a) 4
(b) 2
(c) 6
(d) 8
(d) 8

Question 81.
char data type has ________ byte.
(a) 2
(b) 1
(c) 3
(d) 4
(b) 1

Question 82.
__________ are user-defined names assigned to specific memory locations in which the values are stored.
(a) Variables
(b) Int
(c) Float
(d) Void
(a) Variables

Question 83.
There are _____ values associated with a symbolic variable.
(a) one
(b) two
(c) three
(d) four
(b) two

Question 84.
Declaration of more than one variable in a single statement is separated by using:
(a) :
(b) ,
(c) ;
(d) .
(b) ,

Question 85.
Assigning an initial value to a variable during its declaration is called as:
(a) execution
(b) declaration
(c) initialization
(d) compilation
(c) initialization

Question 86.
A variable that can be initialized during the execution of a program is called:
(a) dynamic initialization
(b) static initialization
(c) compilation
(d) initialization
(a) dynamic initialization

Question 87. _________ manipulator is a member of iostream header file.
(a) endl
(b) setw
(c) setprecision
(d) setf
(a) endl

Question 88.
__________ manipulator sets the width of the field.
(a) setw ( )
(b) set precision ( )
(c) setfill ( )
(d) setf ( )
(a) setw ( )

Question 89.
________ is a combination of operators, constants and variables arranged as per the rules of C++.
(a) Expression
(b) Constant
(c) Keywords
(d) Identifiers types of expressions
(a) Expression

Question 90.
There are _______ available in C++.
(a) three
(b) four
(c) six
(d) seven
(d) seven

Question 91.
The process of converting one fundamental type into another is called as:
(a) type conversion
(b) float conversion
(c) compilation
(d) execution
(a) type conversion

Question 92.
C++ provides ______ types of conversion.
(a) two
(b) three
(c) six
(d) seven
(a) two

Question 93.

 (i) Arithmetic operation (a) a*=5 (ii) Relational operation (b) a+b (iii) Unary operation (c) a<=b (iv) Assignment operation (d) ++a

(a) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)
(b) (i) – (a); (ii) – (d); (iii) – (b); (iv) – (c)
(c) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)
(d) (i) – (d); (ii) – (b); (iii) – (a); (iv) – (c)
(c) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)

Question 94.
Match the following:

 (i) Address of (a) :: (ii) Indirection component selector (b) * (iii) Scope resolution (c) & (iv) Dereference (d) →

(a) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)
(b) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)
(c) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)
(d) (i) – (d); (ii) – (c); (iii) – (a); (iv) – (b)
(a) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)

Question 95.
Identify the correct statement:
(a) cin>x;
(b) cin>>x>>;
(c) cin>>x>>y;
(d) cin>>x<>x>>y;
(c) cin>>x>>y;

Question 96.
Identify the incorrect statement:
(a) The operator « is called the “stream insertion” or “put to” operator
(b) Semantic error is also called as “Logic error”
(c) In C++ the source code should be saved with the extension .c
(d) Compilation translates the source code into machine readable object file with an extension.obj
(c) In C++ the source code should be saved with the extension .c

Question 97.
Choose the odd man out:
(a) getch
(b) endl
(c) setw
(d) setf
(a) getch

Question 98.
Assertion (A):
Process of converting one fundamental type into another is called as “Type conversion”.
Reason (R):
An expression is a combination of operators, Constants and Variable.
(a) Both A and R are true and RJs the correct explanation for A. extension .obj
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(b) Both A and R are true, but R is not the correct explanation for A.

Question 99.
Who developed C++?
(a) Charles Babbage
(b) Bjame Stroustrup
(c) Bill Gates
(d) Sundar Pichai
(b) Bjame Stroustrup

Question 100.
What was the original
(a) CPP
(c) C with Classes
(d) Class with C
(c) C with Classes

Question 101.
Who coined C++?
(a) Rick Mascitti
(b) Rick Bjrane
(c) Bill Gates
(d) Dennis Ritchie
(a) Rick Mascitti

Question 102.
The smallest individual unit in a program is:
(a) Program
(b) Algorithm
(c) Flowchart
(d) Tokens
(d) Tokens

Question 103.
Which of the following operator is extraction operator of C++?
(a) >>
(b) <<
(c) <>
(d) ^^
(a) >>

Question 104.
Which of the following statements is not true?
(a) Keywords are the reserved words convey specific meaning to the C++ compiler.
(b) Reserved words or keywords can be used as an identifier name.
(c) An integer constant must have at least one digit without a decimal point.
(d) Exponent form of real constants consists of two parts.
(b) Reserved words or keywords can be used as an identifier name.

Question 105.
Which of the following is a valid string literal?
(a) ‘A’
(b) ‘Welcome’
(c) 1232
(d) “1232”
(d) “1232”

Question 106.
A program written in high level language is called as:
(a) Object code
(b) Source code
(c) Executable code
(d) All the above
(b) Source code

Question 107.
Assume a = 5, b = 6; what will be result of a&b?
(a) 4
(b) 5
(c) 1
(d) 0
(a) 4

Question 108.
Which of the following is called as compile time operators?
(a) sizeof
(b) pointer
(c) virtual
(d) this
(a) sizeof

Question 109.
How many categories of data types available in C++?
(a) 5
(b) 4
(c) 3
(d) 2
(c) 3

Question 110.
Which of the following data types is not a fundamental type?
(a) designed
(b) int
(c) float
(d) char
(a) designed

Question 111.
What will be the result of following statement?
charch=‘B’;
cout<<(int) ch;
(a) B
(b) b
(c) 65
(d) 66
(d) 66

Question 112.
Which of the character is used as suffix to indicate a floating point value?
(a) F
(b)C
(c) L
(d) D
(a) F

Question 113.
How many bytes of memory allocates for the following variable declaration if you are using Dev C++? short int x;
(a) 2
(b) 4
(c) 6
(d) 8
(a) 2

Question 114.
What is the output of the following snippet?
char ch = ‘A’;
ch = ch + 1;
(a) B
(b) A1
(c) F
(d) 1A
(a) B

Question 115.
Which of the following is not a data type modifier?
(a) signed
(b) int
(c) belong
(d) short
(b) int

Question 116.
Which of the following operator returns the size of the data type?
(a) sizeof ( )
(b) int ( )
(c) long ( )
(d) double ( )
(a) sizeof ( )

Question 117.
Which operator to be used to access reference of a variable?
(a) \$
(b) #
(c) &
(d) \
(c) &

Question 118.
This can be used as alternate to endl command:
(a) \t
(b) \b
(c) \0
(d) \n
(d) \n

## TN State Board 11th Computer Science Important Questions Chapter 8 Iteration and Recursion

Question 1.
Define iteration.
In iteration, the loop body is repeatedly executed as long as the loop condition is true. Each time the loop body is executed, the variables are updated. However, there is also a property of the variables which remains unchanged by the execution of the loop body.

Question 2.
Define Recursion.
Recursion is an algorithm design technique, closely related to induction. It is similar to iteration, but more powerful. Using recursion, a problem can be solved with a given input, by solving the instances of the problem with a part of the input.

Question 3.
What is Base case.
The problem size is small enough to be solved directly. Output the solution. There must be at least one base case.

Question 4.
Define recursive call.
To solve a problem recursively, the solver reduces the problem to sub-problems and calls another instance of the solver, known as sub-solver, to solve the sub-problem. The input size to a sub-problem is smaller than the input size to the original problem. When the solver calls a sub-solver, it is known as recursive call.

Question 5.
Give the difference between Recursion and Iteration.

 Recursion Iteration The statement in a body of function calls the function itself. Allows the set of instructions to be executed repeatedly. It is always applied to functions. It is applied to iteration statements or “loops”. It reduces the size of the code. It makes the code longer.

Question 6.
If we execute the following assignment with, (p, c = 10, 9) after the assignment (u, v) = (11, 10) discover an invariant. What is the value of p – c before and after?
— before : p, c = 10, 9
p, c := p + 1, c + 1
— after: p, c = 11, 10
before: p – c = 10 – 9 = 1
after: p – c = 11 – 10 = 1
We find that p – c = 1 is an invariant.

Question 7.
Show that p – c is an invariant of the assignment.
p, c := p + 1, c + 1
Let P(p, c) = p – c. Then
P (p, c) [p, c := p + 1, c + 1]
= p – c [p, c := p + 1, c + 1]
= (p + 1) – (c + 1)
= p – c
= p(P, c)
Since (p – c) [p, c := p + 1, c + 1] = p – c, p – c is an invariant of the assignment p, c := p + 1, c+ 1.

Question 8.
There are 6 equally spaced trees and 6 sparrows sitting on these trees, one sparrow on each tree. If a sparrow flies from one tree to another, then at the same time another sparrow flies from its tree to some other tree the same distance away, but in the opposite direction. It is possible for all the sparrows to gather on one tree?
Let us index the trees from 1 to 6. The index of a sparrow is, the index of the tree it is currently sitting on. A pair of sparrows flying can be modeled as an iterative step of a loop. When a sparrow at tree i flies to tree i + d, another sparrow at tree j flies to tree j – d. Thus, after each iterative step, the sum S of the indices of the sparrows remains invariant. Moreover, a loop invariant is true at the start and at the end of the loop.

At the start of the loop, the value of the invariant is or White White. It is illustrated in Figure and annotated in the algorithm below.

S = 1 + 2 + 3 + 4 + 5 + 6 = 21

When the loop ends, the loop invariant has the same value. However, when the loop ends, if all the sparrows were on the same tree, say k, then S = 6k.

 S = 21, loop invariant at the start of the loop S = 6k, loop invariant at end of the loop 6k = 21, loop invariant has the same value at the start and the end 21 is a multiple of 6

It is not possible. 21 is not a multiple of 6. The desired final values of the sparrow indices is not possible with the loop invariant. Therefore, all the sparrows cannot gather on one tree.

Question 9.
You are given a jar full of two kinds of marbles, white and black, and asked to play this game. Randomly select two marbles from the jar. If they are the same color, throw them out, but put another black marble in (you may assume that you have an endless supply of spare marbles). If they are different colors, place the white one back into the jar and throw the black one away. If you knew the original numbers of white and black marbles, what is the color of the last marble in the jar?

The number of white and black marbles in the jar can be represented by two variables w and b. In each iterative step, b and w change depending on the colors of the two marbles taken out: Black Black, Black White or White White. It is illustrated in Figure and annotated in the algorithm below.

1 while at least two marbles in jar
2 b, w
3 take out any two marbles
4 case both are black– BB
5 throw away both the marbles
6 put a black marble back
7 — b = b’1-, w = w’, b+w = b’+w’1- 8 case both are white-W W
9 throw away both the marbles
10 put a black marble back
11 b = b’1+, w = w’2-, b+w = b’+w’1-
12 else –BW
13 throw away the black one
14 put the white one back
15 — b = b’1-, w = w’, b+w = b’+w’1-

For each case, how b, w and b+w change is shown in the algorithm, where b’ and w’ are values of the variables before taking out two marbles. Notice the way w changes. Either it does not change, or decreases by 2. This means that the parity of w, whether it is odd or even, does not change. The parity of w is invariant.

Suppose, at the start of the game, w is even. When the games ends, w is still even. Moreover, only one marble is left, w + b = 1.

 1 w + b = 1 end of the loop 2 w = 0 or w = 1 from 1 3 w is even loop invariant 4 w = 0 from 2, 3 5 b = 1 from 1, 4

Last marble must be black. Similarly, if at the start of the game, there is an odd number of whites, the last marble must be white.

Question 10.
Explain in detail the Recursion problem solving technique.
To solve a problem recursively, the solver reduces the problem to sub-problems, and calls another instance of the solver, known as sub-solver, to solve the sub-problem. The input size to a sub-problem is smaller than the input size to the original problem. When the solver calls a sub-solver, it is known as recursive call.

The magic of recursion allows the solver to assume that the sub¬solver (recursive call) outputs the solution to the sub-problem. Then, from the solution to the sub-problem, the solver constructs the solution to the given problem.

As the sub-solvers go on reducing the problem into sub-problems of smaller sizes, eventually the sub-problem becomes small enough to be solved directly, without recursion. Therefore, a recursive solver has two cases:
(i) Base case:
The problem size is small enough to be solved directly. Output the solution. There must be at least one base case.

(ii) Recursion step:
The problem size is not small enough. Deconstruct the problem into a sub-problem, strictly smaller in size than the given problem. Call a sub solver to solve the sub-problem. Assume that the sub-solver outputs the solution to the sub-problem. Construct the solution to the given problem.
This outline of recursive problem solving technique is shown below.
solver (input)
if input is small enough
construct solution
else
find sub_problems of reduced input solutions to sub_problems = solver
for each sub_problem construct solution to the problem from solutions to the sub_problems

Whenever a problem is solved using recursion, these two cases have to be ensured. In the recursion step, the size of the input to the recursive call is strictly smaller than the size of the given input and there is at least one base case.

Question 11.
What is an invariant?
An invariant is a condition that can be relied upon to be true during execution of a program or during some portion of it. It is a logical assertion that is held to always be true during a certain phase of execution.

Question 12.
Define a loop invariant.
A loop invariant is a condition that is necessarily true immediately before and immediately after each iteration of a loop.

Question 13.
Does testing the loop condition affect the loop invariant? Why?
No. It does not affect the loop invariant.

1. at the start of the loop (just before the loop)
2. at the start of each iteration (before loop body)
3. at the end of each iteration (after loop body)
4. at the end of the loop (just after the loop)

Question 14.
What is the relationship between loop invariant, loop condition and the input – output recursively?
(i) Establish the loop invariant at the start of the loop.
(ii) The loop body should so update the variables as to progress toward the end and maintain the loop invariant, at the same time.
(iii) When the loop ends, the termination condition and the loop invariant should establish the input-output relation.

Question 15.
What is recursive problem solving?
Each solver should test the size of the input. If the size is small enough, the solver should output the solution to the problem directly. If the size is not small enough, the solver should reduce the size of the input and call a sub-solver to solve the problem with the reduced input.

Question 16.
Define factorial of a natural number recursively.
The factorial of a natural number defined recursively as the base case can be taken as the factorial of the number 0 or 1, both of which are 1. The factorial of some number n is that number multiplied by the factorial of (n -1).

Question 17.
There are 7 tumblers on a table, all standing upside down. You are allowed to turn any 2 tumblers simultaneously in one move. Is it possible to reach a situation when all the tumblers are right side up? (Hint: The parity ‘of the number of upside down tumblers is invariant.)Answer:
(i) u is the number of tumblers upside down 3 cases.
(ii) 1 turn two tumblers the right way up (w: = u + 2)
(iii) 2 turn two tumblers the wrong way up (u: = u- 2)
(iv) 3 turn one the right way up and the other the wrong way up (u: = u + 1 – 1)
The invariant of these assignments.
(i) Parity is a Boolean value (true or false)
(ii) True if (0, 2, 4, 6 ….)
(iii) False if (1, 3, 5, 7….)
(iv) Notation even u
(v) Invariant of u: – u + 2
(vi) Invariant of u: = u – 2
(vii) Even u is an invariant of the problem-
(viii) No matter how many times we turn over pairs of tumbler, the value is even. So It is not possible to reach the situation when all the tumblers are right side up.

Question 18.
A knockout tournament is a series of games. Two players compete in each game; the loser is knocked out (i.e. does not play any more), the winner carries on. The winner of the tournament is the player that is left after all other players have been knocked out. Suppose there are 1234 players in a tournament. How many games are played before the tournament winner is decided?
Let p be no. of players
Let g be no. of games
initially p = 1234, g = 0
p, g: = p-l,g + l
p + g is invariant
finally p = 1, g = 1233.

Question 19.
King Vikramaditya has two magic swords. With one, he can cut off 19 heads of a dragon, but after that the dragon grows 13 heads. With the other sword, he can cut off 7 heads, but 22 new heads grow. If all heads are cut off, the dragon dies. If the dragon has originally 1000 heads, can it ever die? (Hint:The number of heads mod 3 is invariant.)
So (19 -13) = 6 = 0 (mod 3)
So (22 – 7) = 15 = 0 (mod 3)
We note (19 – 13) = (22 – 7) = 0 (mod 3)
The magic swords can never change the number of heads of the dragon mod 3.
Since we start at 1000 = 1 (mod 3) we can never get to 0. The dragon lives.

Question 20.
Assume an 8 × 8 chessboard with the usual coloring. “Recoloring” operation changes the color of all squares of a row or a column. You can recolor re-peatedly. The goal is to attain just one black square. Show that you cannot achieve the goal. (Hint: If a row or column has b black squares, it changes by (|8 – b) – b|).
We start with a normal coloured chess board with number of black squares B = 32 and number of white squares W = 32.
So W – B = 0 which is divisible by 4 and W + B = 64 W – B = 0 mod 4.
Whenever we change the colours of a row or column, we change the colour of 8 squares. Let this row (or column) have W white squares + b black squares w + b = 8 squares. If this operation B increases by 2n, then W decreases by 2n so that W + B = 64 but B – W will change by 4n and if will remain divisible by 4.
W – B = 0 mod 4.
After every operation ‘B – W mod 4” can have no other values.
But the required state has 63 white squares and 1 black square, so it requires.
W – B = 63 – 1 = 62 = 2 mod 4. which is impossible.

Question 21.
Power can also be defined recursively as

Construct a recursive algorithm using this definition. How many multiplications are needed to calculate a 10?
power (a, n)
— inputs : n is an integer; n > 0
–outputs: an
if n = 0–base case
1
else if n is odd then
a × power (a, n – 1)
else
power (a, n/2) × power (a, n/2)

Question 22.
A single-square-covered board is a board of 2n × 2n squares in which one square is covered with a single square tile. Show that it is possible to cover this board with triominoes without overlap.
The size of the problem is n (board of size 2n × 2n). We can solve the problem by recursion. The base case is n = 1. It is a 2 × 2 single-covered board. We can cover it with one triominoe and solve the problem. In the recursion step, divide the single-covered board of size 2n × 2n into 4 sub-boards, each of size 2n – 1 × 2n – 1, by drawing horizontal and vertical lines through the centre of the board. Place atriominoe at the centre of the entire board so as to not cover the single- covered sub-board, as shown in the left-most board of figure. Now, we have four single-covered boards, each of size 2n – 1 × 2n – 1.

Question 1.
In _________ the loop body is repeatedly executed as long as the loop condition is true.
(a) iteration
(b) recursion
(c) function
(d) statement
(a) iteration

Question 2.
________ is a method call to the same method.
(a) Algorithm
(b) Recursion
(c) Function
(d) Loop
(b) Recursion

Question 3.
Who coined the phrase “structured programming”?
(a) Charles Babbage
(b) Douglas Engelbart
(c) George Boole
(d) Dijkstra
(d) Dijkstra

Question 4.
Suppose u, v = 20, 15 before the assignment what are the values of u and v after the assignment statement, u, v := u + 5, v – 5
(a) u, v = 10, 25
(b) u, v = 20, 10
(c) u, v = 25, 10
(d) u, v = 25, 5
(c) u, v = 25, 10

Question 5.
The loop invariant is true in ______ crucial points in a loop.
(a) two
(b) three
(c) four
(d) five
(c) four

Question 6.
There must be atleast _____ base case.
(a) one
(b) two
(c) three
(d) four
(a) one

Question 7.
Who was one of the most influential pioneers of computing science?
(a) E.W. Dijkstra
(b) Douglas Engelbart
(c) George Boole
(d) G Polya
(a) E.W. Dijkstra

Question 8.
A loop invariant need not be true:
(a) at the start of the loop.
(b) at the start of each iteration
(c) at the end of each iteration
(d) at the start of the algorithm
(d) at the start of the algorithm

Question 9.
We wish to cover a chessboard with dominoes, the number of black squares and the number of white squares covered by dominoes, respectively, placing a domino can be modeled by:
(a) b := b + 2
(b) w := w + 2
(c) b, w := bl+, wl+
(d) b:= w
(c) b, w := bl+, wl+

Question 10.
If m × a + n × b is an invariant for the assignment a, b : = a + 8, b + 7, the values of m and n are:
(a) m = 8, n = 7
(b) m = 7, n = – 8
(c) m = 7, n = 8
(d) m = 8, n = -7
(b) m = 7, n = – 8

Question 11.
Which of the following is not an invariant of the assignment?
m, n := m+2, n+3
(a) m mod 2
(b) n mod 3
(c) 3 × m – 2 × n
(d) 2 × m – 3 × n
(c) 3 × m – 2 × n

Question 12.
If Fibonacci number is defined recursively as:

to evaluate F(4), how many times F( ) is applied?
(a) 3
(b) 4
(c) 8
(d) 9
(b) 4

Question 13.
Using this recursive definition

how many multiplications are needed to calculate a10?
(a) 11
(b) 10
(c) 9
(d) 8
(b) 10

## TN State Board 11th Computer Science Important Questions Chapter 7 Composition and Decomposition

Question 1.
What is Pseudo code?
Pseudo code is inbetween English and high level computer languages. In English, the sentences may be long and may not be precise. In computer languages, the syntax has to be followed meticulously. If these two irritants are removed then we have the Pseudo code.

Question 2.
What is flow chart?

1. Flowchart is a diagrammatic notation for representing algorithms.
2. A flowchart is a collection of boxes containing statements and conditions which are connected by arrows showing the order in which the boxes are to be executed.

Question 3.
Write the advantages of flow chart.

1. They are precise. They represent our thoughts exactly.
2. It is easy to understand small flow charts.

Question 4.
Write the disadvantages of flow chart.

1. Flowcharts are less compact than representation of algorithms in programming language or pseudo code.
2. They obscure the basic hierarchical structure of the algorithms.
3. Alternative statements and loops are disciplined control flow structures. Flowcharts do not restrict us to disciplined control flow structures.

Question 5.
What are the three important control flow statements.
There are three important control flow statements:

1. Sequential
2. Alternative
3. Iterative.

Question 6.
Define sequential statement.
A sequential statement is composed in the sequence are executed one after another, in the same order as they are written in the algorithm, and the control flow is said to be sequential. Let SI and S2 be statements. A sequential statement composed of S1 and S2 is written as

S1
S2

Question 7.
Define compound statement.
Statements may be composed of other statements, leading to a hierarchical structure of algorithms. Statements composed of other statements are known as compound statements.

Question 8.
Give the notations for algorithms.
We need a notation to represent algorithms. There are mainly three different notations for representing algorithms.

1. A programming language is a notation for expressing algorithms to be executed by computers.
2. Pseudo code is a notation similar to programming languages. Algorithms expressed in pseudo-code are not intended to be executed by computers, but for communication among people.
3. Flowchart is a diagrammatic notation for representing algorithms. They give a visual intuition of the flow of control, when the algorithm is executed.

Question 9.
Write short notes on variant of alternative statement.
Some times we need to execute a statement only if a condition is true and do nothing if the condition is false. This is equivalent to the alternative statement in which the else- clause is empty. This variant of alternative statement is called a conditional statement. If C is a condition and S is a statement, then
if C
S
is a statement, called a conditional statement, that describes the following action:
(i) Test whether C is true or false.
(ii) If C is true then do S; otherwise do nothing.
The conditional control flow, is depicted in the flowchart of Figure

Question 10.
Explain the process of iterative statement.
An iterative process executes the same action repeatedly, subject to a condition C. If C is a condition and S is a statement, then while C
S
is a statement, called an iterative statement, that describes the following action:
(i) Test whether C is true or false.
(ii) If C is true, then do S and go back to step 1; otherwise do nothing.

The iterative statement is commonly known as a loop. These two steps, testing C and executing S, are repeated until C becomes false. When C becomes false, the loop ends and the control flows to the statement next to the iterative statement. The condition C and the statement S are called the loop condition and the loop body, respectively. Testing the loop condition and executing the loop body once is called an iteration. Now C is known as the termination condition.

Iterative control flow is depicted in the flowchart of Figure. Condition C has two outgoing arrows, true and false. The true arrow points to S box. If C is true, S box is executed and control flows back to C box. The false arrow points to the box after the iterative statement (dotted box). If C is false, the loop ends and the control flows to the next box after the loop.

Question 11.
Write an algorithm to compare two numbers and produces the result as
compare(a, b) = {-1 if a < b, 0 if a = b, 1 if a > b}
1. case a < b
2. result :=-1
3. case a = b
4. result := 0
5. else– a > b
6. result: = 1

Question 12.
Describe the action of the alternative statement with an example.
A condition is a phrase that describes a test of the state. If C is a condition and both S1 and S2 are statements, then
if C
S1
else
S2
is a statement, called an alternative statement, that describes the following action:
(i) Test whether C is true or false.
(ii) If C is true, then do S1; otherwise do S2.

In pseudo code, the two alternatives S1 and S2 are indicated by indenting them from the keywords if and else, respectively. Alternative control flow is depicted in the flowchart of Figure. Condition C has two outgoing arrows, labeled true and false. The true arrow points to the SI box. The false arrow points to S2 box. outgoing arrows of SI and S2 point to the same box, the box after the alternative statement.

Question 13.
Write the specification and algorithm to find minimum of two numbers.
The specification of algorithm minimum is
— minimum(a, b)
— input s : a , b
— outputs: result = a↓b
Algorithm minimum can be defined as
1. minimum(a, b)
2. — a, b
3. if a < b
4. result: = a
5. else
6. result = b
7. — result = a↓b

Question 14.
Write the characteristics of algorithm.
A well defined algorithm has the five basic characteristic as follows.
(i) Input:
Algorithm starts with procedural steps to accept input data. The algorithm must accept one or more data to be processed.

(ii) Definite:
Each operational step or operation must be definite (i.e.) each and every instruction must clearly specify that what should be done.

(iii) Effective: Each operational step can atleast in principle is carried out by a person using a paper and pencil in a . minimum number of times.

(iv)Terminate:
After some minimum number of operation algorithm must come to an end.

(v) Output:
An algorithm is written to solve the problem, therefore it must produce one or more computed.

Question 15.
Draw a flow chart to estimate the volume of a box using its length, breadth and height.

Question 16.
The state changes for the goat, grass and wolf problem as solved in Example 6.2 (Textbook Page No. 117) are shown in Figure 7.13. The values of farmer, goat, grass and wolf are denoted by -4tuples such as LLLL. Write a sequence of state changes is possible from LLLL to RRRR. Find it.
1. – farmer, goat, grass, wolf = L, L, L, L
2. farmer, goat := R, R
3. — farmer, goat, grass, wolf = R, R, L, L
4. farmer := L
5. farmer, goat, grass, wolf = L, R, L, L
6. farmer, grass := R, R
7. — farmer, goat, grass, wolf = R, R, R, L
8. farmer, goat := L, L
9. — farmer, goat, grass, wolf = L, L, R, L
10. farmer, wolf := R, R
11. — farmer, goat, grass, wolf = R, L, R, R
12. farmer: = L
13. – farmer, goat, grass, wolf = L, L, R, R
14. farmer, goat: = R, R
15. — farmer, goat, grass, wolf = R, R, R, R

Question 17.
Draw a flow chart for integer division.

Question 18.
Draw the different types of boxes used in the flow chart. Explain each one of its roles.

Question 19.
On the island of chrome land there are three different types of chameleons: red chameleons, green chameleons and blue chameleons whenever two chameleons of different colours meet they both change color to the third colour. In the end, all should display the same colour.
Let us represent the number of chameleons of each type by variables a, b and c, and their initial values by A, B and C, respectively. Let a – b be the input property. The input-output relation is a = b = 0 and c = A+B+C. Let us name the algorithm monochromatize. The algorithm can be specified as
monochromatize(a, b, c)
– inputs: a=A, b=B, c=C, a=b
— outputs: a = b = 0 , c = A+B+C
In each iterative step, two chameleons of the two types (equal in number) meet and change, their colors to the third one. Eg: if A, B, C = 4, 4, 6, then the series of meetings will result in

In each meeting, a and b each decreases by 1 and c increases by 2. The solution can be expressed as an iterative algorithm. monochromatize(a, b, c)
— inputs: a=A, b=B, c=C, a=b
— outputs: a = b = 0, c = A + B + C
while a > 0
a, b, c:= a – 1; b – 1; c + 2
The algorithm is depicted in the flowchart of Figure.

Question 20.
Draw a flow chart to eat breakfast.

Question 21.
Using function minimum(a, b) define a function minimum 3(a, b, c) to output the minimum of three numbers a, b, and c.
The specification of an algorithm minimum is minimum (a, b, c)
— inputs : (a, b, c)
— outputs: a↓b↓c
Algorithm minimum can be defined as
1. minimum (a, b, c)
2. -a, b, c
3. x = a
4. if b < x then
5. x = b
6. else
7. if c < x then
8. x = c
9. x = a↓b↓ c.

Question 22.
Draw a flow chart to read a number between 0 and 3 and write it in words.

Question 23.
Distinguish between a condition and a statement.

 Condition Statement The conditions are specified by a set of conditional statements having the boolean expressions which are evaluated to a boolean value true or false. A statement is a command given to the computer that instructs the computer to take a specific action. A computer program is made up of a series of statements.

Question 24.
Draw a flowchart for conditional statement.

Question 25.
Both conditional statement and iterative statement have a condition and a statement. How do they differ?
The conditional statement is executed only if the condition is true. Otherwise, nothing is done. Whereas the iterative statement repeatedly evaluates a condition and executes a statement as long as the condition is true.

Question 26.
What is the difference between an algorithm and a program?

 Algorithm Program An algorithm is a list of steps, typically written in some human language, that explains how to perform a specific task. A program is a list of instructions that tells a computer exactly what to do from step to step.

Question 27.
Why is function an abstraction?
After an algorithmic problem is decomposed into subproblems, we can abstract the j subproblems as functions. A function is like a sub-algorithm. Similar to an algorithm, a j function is specified by the input property and the desired input-output relation.

Question 28.
How do we refine a statement?
After decomposing a problem into smaller subproblems, the next step is either to refine the subproblem or to abstract the subproblem.

1. Each subproblem can be expanded into more detailed steps. Each step can be further expanded to still finer steps, and so on. This is known as refinement.
2. We can also abstract the subproblem. We specify each subproblem by its input property and the input-output relation, While solving the main problem, we only need to know the specification of the subproblems. We do not need know how the subproblems are solved.

Question 29.
For the two flowcharts given below. Write the pseudo code.

(a) start
if a < b then
(if a < c then
print a
else
print c
)
else
(if b < c then
print b
else
print c)
end.

(b) start
sum = 0
n = 1
while n <= 100 then do
sum = sum + a
n = n + 1
print sum
end.

Question 30.
If C is false in line 2, trace the control flow in this algorithm.
1 S1
2 — C is false
3 if C
4 S2
5 else
6 S3
7 S4
(i) Test the condition C is false.
(ii) If C is false the statement SI, S3, S4 is executed.

Question 31.
What is case analysis?
Case analysis splits the problem into an exhaustive set of disjoint cases. For each case, the problem is solved independently. If Cl, C2 and C3 are conditions and S1, S2, S3 and S4 are statements, a 4-case analysis statement has the form,
1. case C1
2. S1
3. case C2
4. S2
5. case C3
6. S3
7. else
8. S4

The conditions C1, C2, and C3 are evaluated in turn. For the first condition that evaluates to true, the corresponding statement is executed, and the case analysis statement ends. If none of the conditions evaluates to true, then the default case S4 is executed.
(i) The cases are exhaustive: at least one of the cases is true. If all conditions are false, the default case is true.
(ii) The cases are disjoint: only one of the cases is true. Though it is possible for more than one condition to be true, the case analysis always executes only one case, the first one that is true. If the three conditions are disjoint, then the four cases are (1) C1, (2) C2, (3) C3, (4) (not C1) and (not C2) and (not C3).

Question 32.
Draw a flowchart for -3case analysis using alternative statements.

Question 33.
Define a function to double a number in two different ways: (1) n + n, (2) 2 × n.
(1) double (n)
— inputs : n
— outputs : n + n
(2) double (n)
— inputs : n
— outputs: 2 × n

Question 34.
Exchange the contents: Given two glasses marked A and B. Glass A is full of apple drink and glass B is full of grape drink. Write the specification for exchanging the contents of glasses A and B, and write a sequence of assignments to satisfy the specification.
drinks (A, B)
— inputs: A, B where A is Apple drink, B is grape drink
— outputs: A (grape drink), B (apple drink)
such that
t: = A
A : = B
B : = t

Question 35.
Circulate the contents: Write the specification and construct an algorithm to circulate the contents of the variables A, B and C as shown below: The arrows indicate that B gets the value of A, C gets the value of B and A gets the value of C.

The specification of the algorithm for circulating the contecontents (a, b, c)
— inputs : a = 10, b = 20, C = 30 -outputs : a = 30, b = 10, C = 20 Algorithm for circulating the contents 0 start
2. temp = b
3. b = a
4. a = c
5. c = temp
6. print a, b, c
7. End

Question 36.
Decanting problem. You are given three bottles of capacities 5, 8 and 3 litres. The 8L bottle is filled with oil, while the other two are empty. Divide the oil in 8L bottle into two equal quantities. Represent the state of the process by appropriate variables. What are the initial and final states of the process? Model the decanting of oil from one bottle to another by assignment. Write a sequence of assignments to achieve the final state.
The goal is to construct a statement so as to move from initial state to final state.
Let A = 5 litre, B = 8 litre, C = 3 litre
— outputs: A (grape drink), B (apple drink) such that
1. A, B, C = 0, 8; 0 (initial state)
2. S
3. A, B, C = 4, 4, 0
Now we have to write a sequence of assignment statement to achieve the final statement.
1. –A, B, C = 0, 8, 0 (initial state)
2. –A, B: = 3, 5
(pour 3 litre in the first bottle)
3. –A, B, C = 3, 5, 0
4. B, C: = 3/2
(pour 2 litre from bottle B to C)
5. –A, B, C = 3, 3, 2
6. –A, B := 6, 0
(pour 3 litre from bottle B to A)
7. –A, B, C = 6, 0, 2
8. A, B:= 1, 5
(pour 5 litre from bottle A to B)
9. –A, B, C = 1, 5, 2
10. B, C = 4, 3
(pour 1 litre from bottle B to C)
11. —A, B, C = 1, 4, 3
12. A, C := 4, 4
(pour three litre from bottle C to A)
13. –A, B, C = 4, 4, 0

Question 37.
Trace the step-by-step execution of the algorithm for fartorial(4). factorial(n)
— inputs : n is an integer, n > 0
— outputs:f = n!
f, i = 1, 1
while i < n
f, i := f × i, i + 1

Factorial (4) = 24
(i) Read the value n = 4
(ii) Assign the value of f = 1, i = 1
(iii) Check the condition i < n if it is true the statement f = f * i
i = i + 1 is executed.
(iv) When the condition goes false the control variable i comes out of the loop and print the result.
Output: n = 24

Question 1.
(a) sequence to print data
(b) selection
(c) repetition
(d) all of above
(d) all of above

Question 2.
__________ is a diagrammatic notation for representing algorithms.
(a) Psuedo code
(b) Flow chart
(c) Statement
(d) Diagrams
(b) Flow chart

Question 3.
The rectangle shaped symbol is used to show the:
(a) errors
(b) decision
(c) process
(d) input / output
(c) process

Question 4.
________ is a mix of programming language – like constructs and plain English.
(a) Pseudo code
(b) Algorithm
(c) Flow chart
(d) Program
(a) Pseudo code

Question 5.
There are ________ important control flow statements.
(a) 2
(b) 3
(c) 4
(d) 5
(b) 3

Question 6.
The ________ statements in the sequence are executed one after another.
(a) sequential
(b) alternative
(c) iterative
(d) control
(a) sequential

Question 7.
The variant of alternative statement is called a _______ statement.
(a) sequential
(b) control
(c) conditional
(d) Iterative
(c) conditional

Question 8.
An ________ process executes the same action repeatedly.
(a) iterative
(b) non-iterative
(c) flow charts
(d) pseudo code
(a) iterative

Question 9.
The elementary problem – solving techniques is:
(a) composition
(b) iteration
(c) decomposition
(d) refinement
(c) decomposition

Question 10.
A _______ is like a sub-algorithm.
(a) Function
(b) Arrays
(c) Pseudo code
(d) Structure
(a) Function

Question 11.
_________ represents a comparison, that determinates alternative paths to be followed:

(a)

(b)

(c)

(d)

(c)

Question 12.
Statements composed of other statements are known as _______ statements.
(a) simple
(b) compound
(c) sequential
(d) iterative
(b) compound

Question 13.
Connector is represented by a:
(a) rectangle
(b) square
(c) oval
(d) small circle
(d) small circle

Question 14.
Control flow statements are called:
(a) compound statements
(b) looping statements
(c) branching statements
(d) control statements
(a) compound statements

Question 15.
A sub problem can be expanded to finer steps:
(a) Decomposition
(b) Refinement
(c) Abstract
(d) Decompose
(b) Refinement

Question 16.
Which is used as a function in solving other problems?
(a) Black box
(b) Red box
(c) Square box
(d) Blue box
(a) Black box

Question 17.
Identify the incorrect statement:
(a) Pseudo-code is a mix of programming – language like constructs and plain English.
(b) Flowchart is a diagrammatic notation for representing algorithms.
(c) A statement is a phrase that commands the computer to do an action.
(d) A sequential statement is not composed of a sequence of statements.
(d) A sequential statement is not composed of a sequence of statements.

Question 18.
Choose the odd from the control flow statements:
(a) Sequential
(b) pseudo-code
(c) Alternative
(d) Iterative
(b) pseudo-code

Question 19.
Match the following:

(a) (i) – (a); (ii) – (b); (iii) – (d); (iv) – (c)
(b) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(c) (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)
(d) (i) – (b); (ii) – (d); (iii) – (c); (iv) – (a)
(b) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)

Question 20.
Suppose u, v = 10, 5 before the assignment. What are the values of u and v after the sequence of assignments?
1 u := v
2 v := u
(a) u, v = 5, 5
(b) u, v = 5, 10
(c) u, v = 10, 5
(d) u, v=10,10
(a) u, v = 5, 5

Question 21.
Which of the following properties is true after the assignment (at line 3?
1– i + j = 0
2 i, j := i + 1, j – 1
3– ?
(a) i + j > 0
(b) i + j < 0
(c) i + j = 0
(d) i = j
(c) i + j = 0

Question 22.
If C1 is false and C2 is true, the compound statement:
1 if C1
2 SI
3 else
4 if C2
5 S2
6 else
7 S3
executes
(a) S1
(b) S2
(c) S3
(d) none
(b) S2

Question 23.
If C is false just before the loop, the control flows through:
1 S1
2 while C
3 S2
4 S3
(a) S1 ; S3
(b) S1 ; S2 ; S3
(c) S1 ; S2 ; S2 ; S3
(d) S1 ; S2 ; S2 ; S2 ; S3
(a) S1 ; S3

Question 24.
If C is true, SI is executed in both the flowcharts, but S2 is executed in:

(a) (1) only
(b) (2) only
(c) both (1) and (2)
(d) neither (1) nor (2)
(a) (1) only

Question 25.
How many times the loop is iterated?
i := 0
while i ≠ 5
i := i + 1
(a) 4
(b) 5
(c) 6
(d) 0
(b) 5

## TN State Board 11th Computer Science Important Questions Chapter 6 Specification and Abstraction

Question 1.
What is a process?
A process evolves, which accpmplishes the intended task or solves the given problem.

Question 2.
What are variables?
Variables are named boxes for storing data. When we do operations on data, we need to store the results in variables. The data stored in a variable is also known as the value of the variable. We can store a value in a variable or change the value of variable, using an assignment statement.

Question 3.
Define function.
A function is like a sub algorithm. It takes an input and produces an output, satisfying a desired input output relation.

Question 4.
What is meant by composition?
An algorithm is composed of assignment and control flow statements. A control flow statement tests a condition of the state and depending on the value of the condition, decides the next statement to be executed.

Question 5.
How will you abstracts the specification of the problem?
Specification abstracts a problem by the properties of the inputs and the desired input-output relation. We recognize the properties essential for solving the problem, and ignore the unnecessary details.

Question 6.
Write the specification of an algorithm to find the square root of a number.
square_root(n)
— inputs: n is a real number, n ≥ 0.
— outputs : y is a real number such that y2 = n.

Question 7.
What are the basic building blocks of an algorithm?
Algorithms are constructed using basic building blocks such as

1. Data
2. Variables
3. Control flow
4. Functions.

Question 8.
Write the control flow statements to alter the control flow depending on the state.
There are three important control flow statements to alter the control flow depending on the state.

1. In sequential control flow, a sequence of statements are executed one after another in the same order as they are written.
2. In alternative control flow, a condition of the state is tested, and if the condition is true, one statement is executed; if the condition is false, an alternative statement is executed.
3. In iterative control flow, a condition of the state is tested, and if the condition is true, a statement is executed. The two steps of testing the condition and executing the statement are repeated until the condition becomes false.

Question 9.
Write a note on Decomposition.
We divide the main algorithm into functions. We construct each function independently of the main algorithm and other functions. Finally, we construct the main algorithm using the functions. When we use the functions, it is enough to know the specification of the function. It is not necessary to know how the function is implemented.

Question 10.
Write the specification in the initial state, all four variables farmer, goat, grass wolf have the variable L. In the final state all four variables should have the value R.
cross_river
— inputs: farmer, goat, grass, wolf = L, L, L, L
— outputs: farmer, goat, grass, wolf = R, R, R, R

Question 11.
Explain the Algorithm Design Techniques.
There are a few basic principles and techniques for designing algorithms.
(i) Specification:
The first step in problem solving is to state the problem precisely. A problem is specified in terms of the input given and the output desired. The specification must also state the properties of the given input, and the relation between the input and the output.

(ii) Abstraction:
A problem can involve a lot of details. Several of these details are unnecessary for solving the problem. Only a few details are essential. Ignoring or hiding unnecessary details and modeling an entity only by its essential properties is known as abstraction. For example, when we represent the state of a process, we select only the variables essential to the problem and ignore inessential details.

(iii) Composition:
An algorithm is composed ofassignmentandcontrolflowstatements. A control flow statement tests a condition of the state and depending on the value of the condition, decides the next statement to be executed.

(iv) Decomposition:
We divide the main algorithm into functions. We construct each function independently of the main algorithm and other functions. Finally, we construct the main algorithm using the functions. When we use the functions, it is enough to know the specification of the function. It is not necessary to know how the function is implemented.

Question 12.
Write the specification of an algorithm to compute the quotient and remainder after dividing an integer A by another integer B.
Let A and B be the input variables. We will store the quotient in a variable q and the remainder in a variable r. So q and r are the output variables.
What are the properties of the inputs A and B?
(i) A should be an integer. Remainder is meaningful only for integer division and ^
(ii) B should not be 0, since division by 0 is not allowed. We will specify the properties of the inputs as
— inputs: A is an integer and B ≠ 0
What is the desired relation between the inputs A and B, and the outputs q and r?
(i) The two outputs q (quotient) and r (remainder) should satisfy the property
A = q × B + r, and
(ii) The remainder r should be less than the divisor B, 0 < r < B
Combining these requirements, we will specify the desired input-output relation as
— outputs: A = q × B + r and 0 < r < B.
The comment that starts with — inputs: actually is the property of the given inputs.
The comment that starts with — outputs: is the desired relation between the inputs and the outputs. The specification of the algorithm is
1. divide (A,B)
2. — inputs: A is an integer and B ≠ 0
3. — outputs : A = q × B + r and 0 < r < B

Question 13.
Define an algorithm.
An algorithm is a step by step sequence of statements intended to solve a problem. When executed with input data, it generates a computational process and ends with output data, satisfying the specified relation between the input data and the output data.

Question 14.
Distinguish between an algorithm and a process.

 Algorithm Process An algorithm is a sequence of instructions to accomplish a task or solve a problem. A process evolves, which accomplishes the intended task or solve the given problem.

Question 15.
Initially, farmer, goat, grass, wolf = L, L, L, L and the farmer crosses the river with goat. Model the action with an assignment statement.
Farmer, goat: = R, R.

Question 16. Specify a function to find the minimum of two numbers.
–min(a, b)
–inputs: a, b
–outputs:result = a↓b

Question 17.
If √2 = 1.414, and the square_root( ) function returns -1.414, does it violate the following specification?
– square_root (x) – inputs: x is a real number, x > 0
– outputs: y is a real number such that y2 = x.

There is no real root of negative numbers. This is because there is no negative square number. When we square a positive number, we multiply positive by positive. When we square a negative number, we multiply negative by negative. In both cases the results are positive, i.e., there is no negative square involved. So there can’t “be a square root of negative numbers.

Question 18.
When do you say that a problem is algorithmic in nature?
A problem is algorithmic in nature when its solution involves the construction of an algorithm. Some types of problems can be immediately recognized as algorithmic.

Question 19.
What is the format of the specification of an algorithm?
The specification in a standard three part format:

1. The name of the algorithm and the inputs.
2. Input: the property of the inputs.
3. Output: the desired input-output relation.

Question 20.
What is abstraction?
Abstraction is the process of ignoring or hiding irrelevant details and modeling a problem only by its essential features. Abstractions are used unconsciously to handle complexity. It is the most effective mental tool used for managing complexity. If we do not abstract a problem adequately, we may deal with unnecessary details and complicate the solution.

Question 21.
How is state represented in algorithms?
State is a basic and important abstraction. Computational processes have state. A computational process starts with an initial state. As actions are performed, its state changes. It ends with a final state. State of a process is abstracted by a set of variables in the algorithm. The state at any point of execution is simply the values of the variables at that point.

Question 22.
What is the form and meaning of assignment statement?
Assignment statement is used to store a value in a variable. The variable is written on the left side of the assignment Operator and a value on the right side.
variable := value
When this assignment is executed, the value on the right side is stored in the variable on the left side. The assignment is m := 2
stores value 2 in variable m.

Question 23.
What is the difference between assignment operator and equality operator?

 Assignment Operator Equality Operator The ‘:=’ is the so – called assignment operator and is used to assign the result of the expression on the right side of the operator to the variable on the left side. The ‘= =’ is the so – called equality comparison operator and is used to check whether the two expressions on both sides are equal or not. It returns true if they are equal and false if they are not equal.

Question 24.
Write the specification of an algorithm hypotenuse whose inputs are the lengths of the two shorter sides of a right angled triangle, and the output is the length of the third side.
hypotenuse (a,b)
–inputs: (a,b)
–outputs: c where
c = (a2 + b2)1/2

Question 25.
Suppose you want to solve the quadratic equation ax2 + bx + c = 0 by an algorithm.
— inputs : ?
– outputs: ?
You intend to use the formula and you are prepared to handle only real number roots. Write a suitable specification.

x = $$\frac{-b \pm \sqrt{b^{2}-4 a c}}{2 a}$$
quadratic – solve (a, b, c)
–inputs: a, b, c are real numbers and a ≠ 0
–outputs: x1, x2 such that
d = (b x b) – (4 x a x c)
x1 = – b + (d)1/2 × a
x2 = – b – (d)1/2 × a

Question 26.
Exchange the contents: Given two glasses marked A and B. Glass A is full of apple drink and glass B is full of grape drink. For exchanging the contents of glasses A and B, represent the state by suitable variables, and write the specification of the algorithm.
drinks(A, B)
— inputs: A, B where A and B are not empty
— outputs: B, A such that
t := A
A := B
B := t

Question 1.
An _________ is a sequence of instructions to accomplish a task or solve a problem.
(a) algorithm
(b) program
(c) instruction
(d) data
(a) algorithm

Question 2.
_________ changes the values of variables and hence the state.
(a) Selection statement
(b) Assignment statement
(c) Control statement
(d) Functions
(b) Assignment statement

Question 3.
_________ are named boxes for storing data.
(a) Variables
(b) Process
(c) Functions
(d) Procedure
(a) Variables

Question 4.
The parts of an algorithm are known as:
(a) procedure
(b) decomposition
(c) abstraction
(d) functions
(d) functions

Question 5.
________ indicates that the rest of the line is a comment in C++.
(a) –
(b) – –
(c) / /
(d) – /
(c) / /

Question 6.
The specification of an algorithm can be _____ part.
(a) four
(b) three
(c) five
(d) two
(b) three

Question 7.
Which symbol is used in algorithmic notation to start a comment line?
(a) –
(b) – –
(c) //
(d) *
(b) – –

Question 8.
A computation is abstracted by a set of variables in:
(a) State
(b) Function
(c) Abstract
(d) Composition
(a) State

Question 9.
Which statement is used to store a value in a variable?
(a) Control
(b) Input
(c) Assignment
(d) Branch
(c) Assignment

Question 10.
Which is known as assignment operator?
(a) :=
(b) + =
(c) + + =
(d) = =
(a) :=

Question 11.
Match the following:

 (a) Relation between the input and the output (i) Decomposition (b) Ignoring or hiding unnecessary details (ii) Composition (c) Assignment and control flow statements (iii) Abstractions (d) Functions (iv) Specification

(a) (iv), (iii), (ii), (i)
(b) (iii), (iv), (i), (ii)
(c) (iv), (ii), (i), (iii)
(d) (iv), (iii), (i), (ii)
(a) (iv), (iii), (ii), (i)

Question 12.
Match the following:

 (i) Functions (a) Ignoring or hiding unnecessary details (ii) Abstraction (b) Composed of assignment and control flow statements (iii) Composition (c) Parts of an algorithm (iv) Decomposition (d) Divide the main algorithm into functions

(a) (i) – (d); (ii) – (b); (iii) – (c); (iv) – (a)
(b) (i) – (b); (ii) – (a); (iii) – (c); (iv) – (d)
(c) (i) – (c); (ii) – (a); (iii) – (b); (iv) – (d)
(d) (i) – (a); (ii) – (b); (iii) – (d); (iv) – (c)
(c) (i) – (c); (ii) – (a); (iii) – (b); (iv) – (d)

Question 13.
Assertion (A):
An algorithm is a sequence of instructions to accomplish a task or solve a problem.
Reason (R):
An instruction describes an action.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true, and R is the correct explanation for A.

Question 14.
Assertion (A):
Specification cannot abstract a problem by the properties of the inputs and the desired input-output relation.
Reason (R):
We can recognize the properties essential for solving the problem and ignore the unnecessary details.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(d) A is false, but R is true.

Question 15.
Which of the following activities is algorithmic in nature?
(a) Assemble a bicycle
(b) Describe a bicycle
(c) Label the parts of a bicycle
(d) Explain how a bicycle works
(a) Assemble a bicycle

Question 16.
Which of the following activities is not algorithmic in nature?
(a) Multiply two numbers
(b) Draw a kolam
(c) Walk in the park
(d) Swaping of two numbers
(a) Multiply two numbers

Question 17.
Omitting details inessential to the task and representing only the essential features of the task is known as:
(a) specification
(b) abstraction
(c) composition
(d) decomposition
(b) abstraction

Question 18.
Stating the input property and the input- output relation a problem is known:
(a) specification
(b) statement
(c) algorithm
(d) definition
(a) specification

Question 19.
Ensuring the input-output relation is:
(a) the responsibility of the algorithm and the right of the user.
(b) the responsibility of the user and the right of the algorithm.
(c) the responsibility of the algorithm but not the right of the user.
(d) the responsibility of both the user and the algorithm.
(a) the responsibility of the algorithm and the right of the user.

Question 20.
If i = 5 before the assignment i := i – 1 after the assignment, the value of i is:
(a) 5
(b) 4
(c) 3
(d) 2
(b) 4

Question 21.
If 0 < i before the assignment i := i – 1 after the assignment, we can conclude that:
(a) 0 < i
(b) 0 ≤ i
(c) i = 0
(d) 0 ≥ i
(b) 0 ≤ i

## TN State Board 11th Computer Science Important Questions Chapter 5 Working with Typical Operating System (Windows & Linux)

Question 1.
What is an operating system?
An Operating System (OS) is a system software that enables the hardware to communicate and operate with other software. It also acts as an interface between the user and the hardware and controls the
overall execution of the computer.

Question 2.
What is Desktop?
The opening screen of Windows is called ‘Desktop’. The desktop shows the Start button, Taskbar, Notification Area and date and time.

Question 3.
What is an Icon?
Icon is a graphic symbol representing the window elements like files, folders, shortcuts etc., It plays a vital role in GUI based applications.

Question 4.
What is window?
Window is a typical rectangular area in an application or a document. It is an area on the screen that displays information for a specific program.

Question 5.
What is Application Window?
It is an area on a computer screen with defined boundaries and within which information is displayed. Such windows can be resized, maximized, minimized, placed side by side, overlap, and so on.

Question 6.
What is document window?
The smaller window, which is inside the Application Window, is called the Document window. This Window is used for typing, editing, drawing, and formatting the text and graphics.

Question 7.
Where the task bar is located? What it contains?
A horizontal bar at the bottom of the screen is called the taskbar. This bar contains (from left to right) the Start button, shortcuts to various programs, minimized programs and in the extreme right comer you can see the system tray which consist of volume control, network, date and time etc. Next to the Start button is the quick Launch Toolbar which contains task for frequently used applications.

Question 8.
Multiple applications can execute simultaneously in Windows, and this is known as “multitasking”.

Question 9.
What is launcher?
The vertical bar of icons on the left side of the desktop is called the Launcher. The Launcher provides easy access to applications, mounted devices and the Trash. All current applications on your system will place an icon in the Launcher.

Question 10.
How will you delete a file in Ubuntu OS?
A file / folder created by user can be moved to j trash by using right click or by using menu.

Question 11.
Define Ubuntu.
Ubuntu is a Linux-based operating system. It is designed for computers, smartphones and network servers. The system is developed by a UK based company called Canonical Ltd.
Ubuntu was conceived in 2004 by Mark Shuttleworth, a successful South African entrepreneur.

Question 12.
Define Trash.
Trash is the equivalent of Recycle bin of windows OS. All the deleted files and folders are moved here.

Question 13.
List the functions of an operating system.

1. Memory Management
2. Process Management
3. Device Management
4. File Management
5. Security Management
6. Control overall system performance
7. Error detecting aids
8. Coordination between other software and users.

Question 14.
Write some of the most popular operating systems.

1. Windows Series – for desktop and laptop computers.
2. Android – for smart phones.
3. iOS – for Apple phones, i-Pad and i-Pod.
4. Linux – Open source Operating System for desktop and server.

Question 15.
Write down the various mouse actions.

 Action Reaction Point to an item Move the mouse pointer over the item. Click Point to the item on the screen, press and release the left mouse button. Right click Point to the item on the screen, press and release the right mouse button. Clicking the right mouse button displays a pop up menu with various options. Double click Point to the item on the screen, quickly press twice the left mouse button. Drag and drop Point to an item then hold the left mouse button as you move the pointer and when you have reached the desired position, release the mouse button.

Question 16.
Explain the icons in windows operating system.
Icon:
It is a graphic symbol representing the window elements like files, folders, shortcuts etc. It plays a vital role in GUI based applications.

Standard Icons:
The icons which are available on desktop by default while installing Windows OS are called standard icons. The standard icons available in all Windows OS are My Computer, Documents and Recycle Bin.

Shortcut Icons:
It can be created for any application or file or folder. By double clicking the icon, the related application or file or folder will open. This represents the shortcut to open a particular application.

Disk drive icons:
The disk drive icons graphically represent five disk drive options.

1. Hard disk
2. CD-ROM/DVD Drive
3. Pen drive
4. Other removable storage such as mobile, smart phone, tablet etc.,
5. Network drives if your system is connected with other system.

Question 17.
Write the difference between the application window and the document window.

 Application Window Document Window The larger window is called the Application Window. The smaller window, which is inside the Application Window is called the Document Window. This window helps the user to communicate with the Application Program. This window is used for typing, editing, drawing and formatting the text and graphics.

Question 18.
Write the ways of creating folders in windows.
Method I:
Step 1: Open Computer Icon.
Step 2: Open any drive where you want to create a new folder. (For example select D:)
Step 3: Click on File → New → Folder.
Step 4: A new folder is created with the default name “New folder”.
Step 5: Type in the folder name and press Enter key.

Method II:In order to create a folder in the desktop:
Step 1: In the Desktop, right click → New → Folder.
Step 2: A Folder appears with the default name “New folder” and it will be highlighted.
Step 3: Type the name you want and press Enter Key.
Step 4: The name of the folder will change.

Question 19.
Write the steps to delete a file or folders in windows.
Select the file or folder you wish to delete.
(i) Right-click the file or folder, select Delete option from the pop-up menu or Click File → Delete or press Delete key from the keyboard.
(ii) The file will be deleted and moved to the Recycle bin.

Question 20.
Write short note on Recycle Bin.
Recycle bin is a special folder to keep the files or folders deleted by the user, which means user still have an opportunity to recover them. The user cannot access the files or folders available in the Recycle bin without restoring it. To restore file or folder from the Recycle Bin.

1. Open Recycle bin.
2. Right click on a file or folder to be restored and select Restore option from the pop-up menu.
3. To restore multiple files or folders, select Restore all items.
4. To delete all files in the Recycle bin, select Empty the Recycle Bin.

Question 21.
Write the steps to create shortcuts on the Desktop.
Shortcuts to your most often used folders and files may be created and placed on the Desktop to help automate your work.

1. Select the file or folder that you wish to have as a shortcut on the Desktop.
2. Right click on the file or folder.
3. Select Send to from the shortcut menu, then select Desktop (create shortcut) from the sub-menu.
4. A shortcut for the file or folder will now appear on your desktop and you can open it from the desktop in the same way as any other icon.

Question 22.
Write the significant features of Ubuntu.

1. The desktop version of Ubuntu supports all normal software like Windows such as Firefox, Chrome, VLC, etc.
2. It supports the office suite called LibreOffice.
3. Ubuntu has in-built email software called Thunderbird, which gives the user access to email such as Exchange, Gmail, Hotmail, etc.
4. There are free applications for users to view and edit photos, to manage and share videos.
5. It is easy to find content on Ubuntu with the smart searching facility.
6. The best feature is, it is a free operating system and is backed by a huge open source community.

Question 23.
What is Ambiance?
The default desktop background, or wallpaper, belonging to the default Ubuntu 16.04 theme is known as Ambiance.

Question 24.
Write the steps to create files in the windows.
Wordpad is an in-built word processor application in Windows OS to create and manipulate text documents.
In order to create files in wordpad you need to follow the steps given below.

1. Click Start → All Programs → Accessories → Wordpad or Run → type Wordpad, click OK. Wordpad window will be opened.
2. Type the contents in the workspace and save the file using File → Save or Ctrl + S.
3. Save As dialog box will be opened.
4. In the dialog box, select the location where you want to save the file by using look in drop down list box.
5. Type the name of the file in the file name textbox.
6. Click save button.

Question 25.
Draw and explain the elements of windows.
Title Bar:
The title bar will display the
name of the application and the name of the document opened. It will also contain minimize, maximize and close button.

The menu bar is seen under the title bar. Menus in the menu bar can be accessed by pressing Alt key and the letter that appears underlined in the menu title. Additionally, pressing Alt or F10 brings the focus on the first menu of the menu bar.
In Windows 7, in the absence of the menu bar, click Organize and from the drop down menu, click the Layout option and select the desired item from that list.

The Workspace:
The workspace is the area in the document window to enter or type the text of your document.

Scroll bars:
The scroll bars are used to scroll the workspace horizontally or vertically. Comers and borders:The comers and borders of the window helps to drag and resize the windows. The mouse pointer changes to a double headed arrow when positioned over a border or a comer. Drag the border or comer in the direction indicated by the double headed arrow to the desired. The window can be resized by dragging the comers diagonally across the screen.

Question 26.
Write the steps to log off / shut down the computer.
(i) Click start → log off (click the arrow next to Shut down) or Start → Shutdown.
(ii) If any programs are opened, then it will be asked to close them or windows will Force shut down, user will lose any un saved information if you do this.
(iii) Switch User: Switch to another user account on the computer without closing open programs and Windows processes.
(iv) Log Off: Switch to another user account on the computer after closing all open programs and Windows processes.
(v) Lock: Lock the computer while you’re away from it.
(vi) Restart: Reboot the computer. (This option is often required as part of installing new software or Windows update.)
(vii) Sleep: Puts the computer into a low- power mode that retains all miming programs and open Windows in computer memory for a super-quick restart.
(viii) Hibernate (found only on laptop computers): Puts the computer into a low-power mode after saving all miming programs and open windows on the machine’s hard drive for a quick restart.

Question 27.
Explain the different method of renaming files and folders.
There are number of ways to rename files or folders. You can rename using the File menu, left mouse button or right mouse button.
Method I: Using the FILE Menu

1. Select the File or Folder to Rename.
2. Click File → Rename.
3. Type in the new name.
4. To finalise the renaming operation, press Enter.

Method II:Using the Right Mouse Button

1. Select the file or folder to rename.
2. Click the right mouse button over the file or folder.
3. Select Rename from the pop-up menu.
4. Type in the new name.
5. To finalise the renaming operation, press Enter.
6. The folder “New Folder” is renamed as C++.

Method III: Using the Left Mouse Button

1. Select the file or folder to rename.
2. Press F2 or click over the file or folder. A surrounding rectangle will appear around the name.
3. Type in the new name.
4. To finalise the renaming operation, press Enter.

Question 28.
What are the different method of copying files and folders to removable disk.
There are several methods of transferring files to or from a removable disk.
(i) Copy and Paste
(ii) Send To

Method I: Copy and Paste
(a) Plug the USB flash drive directly into an available USB port.
(b) If the USB flash drive or external drive folder does NOT open automatically, the following steps are followed.
(c) Click Start → Computer.
(d) Double-click on the Removable Disk associated with the USB flash drive.
(e) Navigate to the folders in computer containing files to be transfered.

Right-click on the file to copy, then select Copy.
Return to the Removable Disk window, right- click within the window, then select Paste.

Method II: Send To
(a) Plug the USB flash drive directly into an available USB port.
(b) Navigate to the folders in computer containing files to be transfered.
(c) Right-click on the file transfer to removable disk.
(d) Click Send To and select the Removable Disk associated with the USB flash drive.

Question 29.
Explain the indicators in the menubar of Ubuntu OS.
(i) Network indicator:
This manages network connections, allowing user to connect to a wired or wireless network.

(ii) Text entry settings:
This shows the current keyboard layout (such as En, Fr,Ku, and so on) . If more than one keyboard layout is shown, it allows to select a keyboard layout out of those choices. The keyboard indicator menu contains the following menu items: Character Map, Keyboard Layout Chart, and Text Entry Settings.

(iii) Messaging indicator:
This incorporates your social applications. From here, user can access instant messenger and email clients.

(iv) Sound indicator:
This provides an easy way to adjust the volume as well as access the music player.

(v) Clock:
This displays the current time and provides a link to calendar and time and date settings.

(vi) Session indicator:
This is a link to the system settings, Ubuntu Help and session options (like locking your computer, user/guest session, logging out of a session, restarting the computer or shutting down completely).

(vii) Title bar:
The title bar shows the name of the currently selected directory. It also contains the Close, Minimize, and Maximize buttons.

(viii) Toolbar:
The toolbar displays user directory browsing history (using two arrow buttons), location in the file system, a search button and options for current directory view.

Question 30.
How will you move files and folders?
Method I: CUT and PASTE
To move a file or folder, first select the file or
folder and then choose one of the following:
(i) Click on the Edit → Cut or Ctrl + X or right click → cut from the pop-up menu.
(ii) To move the filets) or folder(s) in the new location, navigate to the new location and paste it using Click Edit → Paste from edit menu or Ctrl + V using keyboard.
(in) Or Right click → Paste from the pop-up menu. The file will be pasted in the new location.

Method II: Drag and Drop
In the disk drive window, there are two panes called left and right panes. In the left pane, the files or folders are displayed like a tree structure. In the right pane, the files inside the specific folders in the left pane are displayed with various options.

(i) In the right pane of the Disk drive window, select the file or folder to be moved.
(ii) Click and drag the selected file or folder from the right pane, to the folder list on the left pane.
(iii) Release the mouse button when the target folder is highlighted (active).
(iv) File or folder will now appear in the new area.

Question 31.
How will you copy files and folders in windows?
There are variety of ways to copy files and folders:
Method I: COPY and PASTE
To copy a file or folder, first select the file or folder and then choose one of the following:
(i) Click Edit → Copy or Ctrl + C or right click → Copy from the pop-up menu.
(ii) To paste the file(s) or folder(s) in the new location, navigate to the target location then do one of the following:
(iii) Click Edit → Paste or Ctrl + V.
(iv) Or Right click → Paste from the pop-up menu.

Method II: Drag and Drop
(i) In the RIGHT pane, select the file or folder to be copied.
(ii) Click and drag the selected file and/or folder to the folder list on the left, and drop it where to copy the file and/or folder.
(iii) File(s) and folder(s) will now appear in the new area.

Question 32.
Click, Run option on the Start menu, the Run dialog box appears. Type the “Word Pad” in the open window box, then press OK button. Now, wordpad window is opened.
Close the Wordpad application using File
Click, File → Exit (or) File → Close.

Question 33.
Create a Folder in My Documents with your name using any one of the methods discussed.
(i) Open My Computer or Computer icon.
(ii) Open any drive where you want to create a new folder, (eg: select D drive)
(iii) Click on File → New → Folder.
(iv) Now, a new folder is created with the default name “New Folder”.
(v) Type in the New Folder for your name and press Enter key. Now, Folder name created for you name.

Question 34.
Open the Wordpad application and save it under a folder created with your name in My Document.

1. Click Start → All programs → Accessories → Wordpad (or) Run → type Wordpad, click OK. Wordpad window will be opened.
2. Type the contents in the workspace and save the file using File → save or Ctrl + S.
3. Save As dialog box will be opened.
4. In this dialog box, select the drive name and folder name, where you want to save the file.
5. Now, type the name of the file in the file name text box.
6. Click save button.

Question 35.
Find the file created in Workshop-3 using the above procedure.

1. Click computer icon from desktop or from start menu.
2. The computer disk drive screen will be appear and at the top right comer of that screen, there is a search box.
3. Type the name of File / Folder you want I to search. Even if you give the part of the File or Folder name. It will displays the list of files or folders starting with the specified name.
4. Just click and open that file or the folder.

Question 36.
Rename the file created by you using the File menu, left mouse button or right mouse button.
Method 1:

1. Select the file or folder to Rename.
2. Click File → Rename.
3. Type in the new name as you desired.
4. Press Enter key.

Method 2:

1. Select the file or folder to rename.
2. Click the right mouse button over the file or folder.
3. Select Rename from the pop-up menu.
4. Type in the new name.
5. Press Enter key.

Question 37.
Find the file created in Workshop-3 using the above procedure.

1. Click computer icon from desktop or from start menu.
2. The computer disk drive screen will be appear and at the top right comer of that screen, there is a search box.
3. Type the name of File / Folder you want I to search. Even if you give the part of the File or Folder name. It will displays the list of files or folders starting with the specified name.
4. Just click and open that file or the folder.

Question 38.
Rename the file created by you using the File menu, left mouse button or right mouse button.
Method 1:

1. Select the file or folder to Rename.
2. Click File → Rename.
3. Type in the new name as you desired.
4. Press Enter key.

Method 2:

1. Select the file or folder to rename.
2. Click the right mouse button over the file or folder.
3. Select Rename from the pop-up menu.
4. Type in the new name.
5. Press Enter key.

Question 39.
Move the file created by you in My Documents to Drive D:.
There are variety of ways to copy files and folders.
Drag and drop method:

1. Open computer icon.
2. In the disk drive window, there are two panes called left and right panes. In the left pane, the files or folders are displayed like a tree structure. In the right pane, the files inside the specific folders in the left pane are displayed with various options.
3. In the right pane of the disk drive window, select My Documents with created your file name.
4. Click filename and drag to drive D: in the left pane.
5. Release the mouse button, now file name is moved from My Documents to Drive D.
6. Drive D: to a removable Disk.

* Copy the file created by you from drive D: to a removable disk.

1. Plug the USB flash drive directly into an available USB port, (or)
2. Click start → Computer.
3. Click Drive D: Select file name you want to move.
4. Click the right mouse button, send to option and select the Removable Disk with the USB flash drive.

Question 40.
Delete the file created by you after duplicating the same under My Documents.

1. Select My Documents, then click to delete.
2. Right-click the file created. Select Delete Option from the pop-up menu (or) Click File → Delete (or) Press Delete key from the keyboard.
3. The file will be deleted from the My Documents and moved to the Recycle bin.

Question 41.
Differentiate cut and copy options.

 Cut Copy When an object is cut from a document it is completely removed and placet into a clipboard. When an object is copied a duplicate of it is placed into a clipboard while the original remains in place. Ctrl + X and Ctr + V is the shortcul command for cul and paste. Ctrl + C and Ctrl + V is the shortcul command for copy and paste.

Question 42.
What is the use of a file extension?
The extension of the file name simply says the format in which the data in the file is stored.
Eg: If a file is named letter.doc, the .doc is the file extension, and it tells windows that

Question 43.
Differentiate Files and Folders.

 Files Folders A file is a collection of data on a single unit. It can be anything from a word file to a music, video or photo file. Folders are places where files are stored. Folders can contain folders inside them. Files have a size ranging from a few bytes to several giga bytes. Folders take up no space on hard drive.

Question 44.
Differentiate save and save as option.

 Save Save as The ‘save’ simply saves our work by updating the Iasi saved version o1 the file to match the current version we see on our screen. The ‘save as’ brings upto save our work as a file with a different name.

Question 45.
What is Open Source?

1. Open Source refers to a program or software in which the source code is available in the web to the general public free of cost.
2. Open Source code is typically created as a collaborative effort in which programmers continuously improve upon the source code in the web and share the changes within the community.

Question 46.
What are the advantages of open source?
The advantages of open sources are better security, better quality, more control, no vendor dependence, easier licence management.

Question 47.
Mention the different server distributions in Linux OS.

• Ubuntu Linux
• Linux Mint
• Arch Linux
• Deepin
• Fedora
• Debian
• CentOS

Question 48.
How will you log off from Ubuntu OS?
When you have finished working on your computer, you can choose to Log Out, Suspend or Shut down through the Session Indicator on the far right side of the top panel.

Question 49.
Analyse:
Why the drives are segregated?
A drive is a computer component used to store data. Partitioning a hard drive essentially tells the computer to treat portions of that drive as separate entities. It can be for a variation for reasons, keeping things organized, creating a backup and recovery partition.

(i) Multiple file systems:
If we require
different file systems on our computer for specific action then we make multiple partition and assign one type of file system to one of the partitions and another to one of the other partitions.

(ii) Partition size:
If we have more storage space on a hard drive, we would need to create other partitions, to utilize this unused space.

(iii) Multiple operating system:
If we went to use two operating systems on the same computer then we could make two partitions, one for each operating system.

(iv) Wasted disk space:
By having multiple partitions of smaller size, we can reduce the amount of waste that file systems may create.

(v) Separate system files from users files:
By creating a partition we can store system files in one partition and users data to another partition to avoid causing problem.

Question 50.
If you are working on multiple files at a time, sometimes the system may hang. What is the reason behind it. How can you reduce it?
When each program or files are opened, computer takes some of the computer resources to keep it running. If too many programs are opened to one time, computer If we have too many programs open at one time, our computer may be low on resources and it slows down or it may hang. Try only one program running at a time to make sure our hang-ups is not being caused by multiple programs running at the same time.

To determine computer in this situation is by pressing the Num Lock button on the keyboard and watching the Num Lock to see if it turns off and on. To get the light to turn off and on, press Ctrl + Alt + Del and End Task for the hang-up files.

Question 51.
Are drives such as hard drive and floppy drives represented with drive letters? If so why, if not why?
The drive letters plays an important role in telling windows where to look. All the computers with a hard drive will always have that default hard drive assigned to a C: and for floppy drivers has a drive letter of A:.

Question 52.
Write the specific use of Cortana.
Cortana – the personal assistant feature from windows phone. This has become a major part of windows 10 doing double duty as a web search and a start merfu / windows search. Plus the ability to search by voice.
Uses:
(i) It is used to set reminder in our PC.
(ii) It can alert you whenever you miss a call on your phone.
(iii) It can also help find the latest news.

Question 53.
List out the major differences between Windows and Ubuntu OS.

 Windows OS Ubuntu OS It is a GUI based operating system. It is a Linux based operating system. It is a closed source (proprietary software). It is an open source operating system. It is strictly Microsoft company based. It is based around the company canonical and is also community based.

Question 54.
Are there any difficulties you face while using Ubuntu? If so, mention it with reasons.
Yes, Many difficulties are there while using Ubuntu operating system.

1. A lack of familiarity and shared experiences fragments users they do not have a shared any points.
2. Many Linux newbies start with Ubuntu. This should not take away from Ubuntu, it is a testament to its smart design and ease of use.
3. Ubuntu has come a long way regarding hardware compatibility and some accessory hardware will not have the needed software to interface.

Question 55.
Differentiate Thunderbird and Firefox in Ubuntu OS.

 Thunderbird Firefox Ubuntu has in – built email software called Thunderbird. Firefox is a internet browser, you can directly browse the internet. It gives the user Access to email such as Gmail, Hotmail etc., It is the fastest browser and numerous features that protect you, from viruses and other common exploits. There are free applications for users to view and edit photos, to manage and share videos. Fire fox has some advanced security measures that guard against the spyware and viruses.

Question 56.
Differentiate Save, Save As and Save a Copy in Ubuntu OS.
Save:
This will save the document without asking for a new name or location. It will over-write the original.

SaveAs:
This will prompt user to save the document using a dialog box. User will have the ability to change the file name or location.

Save a Copy:
This will prompt user to save a copy using the same dialog box as save as. User will have the ability to change the file name or location. If the name or location of the document is changed user will be working on the original document not the copy. That means if user make additional changes and then hit save the original will be overwritten with new changes, but the copy user saved earlier will be left at the state of the ‘save a copy.

Question 57.
Explain the versions of Windows Operating System.

Question 58.
Draw and compare the icon equivalence in Windows and Ubuntu.

Question 59.
Complete the following matrix:

 Navigational method Located on Ideally suited for Start Button Task bar Quick access to common applications and settings. My Computer Desktop Exploring your disk drives and using system tools. Windows Explorer Task bar Seeing hierarchy of all computer contents and resources in one window. Quick Launch Task bar Enables a user the ability to launch their programs.

Question 60.
Observe the figure and mark all the window elements. Identify the version of the Windows OS.

All the Window elements are same. The version of OS is Windows 10.

Question 61.
Write the procedure to create, rename, delete and save a file in Ubuntu OS. Compare it with Windows OS.
The procedure to create, rename, delete and save a file in Ubuntu OS is similar to windows OS. User can create, rename, delete and save the files and folders with the same procedure by clicking files icon. The some related figure on the desktop represents creating a file or folder by right clicking in the Desktop.
A New Folder can also be created by using menus in the files icon.
A document created by user can be moved to ‘trash’ by using right click or by using menus as in windows.
All the other options like rename, cut, copy can be performed by using right click or by using menus as windows.

Question 1.
Microsoft windows is a based operating system.
(a) GUI
(b) command driven
(c) window
(a) GUI

Question 2.
Multiple applications which can execute simultaneously in windows is known as :
(a) multi programming
(c) time sharing
(d) based on priority

Question 3.
________ is used to interact windows by clicking its elements.
(a) Keyboard
(b) Light pen
(c) Mouse
(d) Scanner
(c) Mouse

Question 4.
_______ is used to enter alphabets and characters.
(a) Light pen
(b) Mouse
(c) Notes taker
(d) Keyboard
(d) Keyboard

Question 5.
Multiple desktop is available in :
(a) windows XP
(b) windows vista
(c) windows 8
(d) windows 10
(d) windows 10

Question 6.
The opening screen of windows is called :
(a) desktop
(b) icons
(c) windows
(d) documents
(a) desktop

Question 7.
The __________ is an area on the screen that displays information for a specific program.
(a) desktop
(b) icons
(c) window
(d) document
(c) window

Question 8.
The larger window is called the:
(a) document window
(b) application window
(c) workspace
(d) scroll bar
(b) application window

Question 9.
The first level in a multilevel or hierarchical directory system is:
(a) root directory
(c) sub directories
(d) directories
(a) root directory

Question 10.
The shortcut keyboard command to cut is:
(a) Ctrl + X
(b) Ctrl + C
(c) Ctrl + V
(d) Ctrl + S
(a) Ctrl + X

Question 11.
The shortcut keyboard command to copy is:
(a) Ctrl + X
(b) Ctrl + C
(c) Ctrl + V
(d) Ctrl + S
(b) Ctrl + C

Question 12.
The shortcut keyboard command to paste is:
(a) Ctrl + X
(b) Ctrl + C
(c) Ctrl + V
(d) Ctrl + A
(c) Ctrl + V

Question 13.
The paste option is on ______ menu.
(a) edit
(b) file
(c) view
(d) tools
(a) edit

Question 14.
______ switches to another user account on the computer without closing the open programs and windows processes.
(a) Log off
(b) Restarting the computer
(c) Shut down
(d) Switch user
(d) Switch user

Question 15.
__________ shows the name of the currently selected directory.
(a) Tool bar
(d) Title bar
(d) Title bar

Question 16.
__________ displays your directory browsing history, location in the file system, a search button and options for the current directory view.
(a) Tool bar
(d) Title bar
(a) Tool bar

Question 17.
Windows 7 was released in :
(a) October 2012
(b) September 2014
(c) October 2009
(d) October 2015
(c) October 2009

Question 18.
A horizontal bar at the very bottom of the screen is called the:
(a) tool bar
(d) title bar

Question 19.
We can select multiple files by holding down the _____ key.
(a) Alt
(b) Shift
(c) Ctrl
(d) Home
(c) Ctrl

Question 20.
________ is located at the top of the screen.
(a) Tool bar
(d) Title bar

Question 21.
The graphic symbol representing the window elements is:
(a) Icon
(b) Desk
(c) Start
(a) Icon

Question 22.
Which shortcut key is used to move the desktop anytime?
(a) Winkey + M
(b) Winkey + V
(c) Winkey + D
(d) Winkey + C
(c) Winkey + D

Question 23.
Which is not available in the windows standard icon?
(a) My computer
(b) Documents
(c) Recycle Bin
(d) Paint icon
(d) Paint icon

Question 24.
Shortcut icons can be created for any:
(a) application
(b) file
(c) folder
(d) all the above
(d) all the above

Question 25.
How many disk drive options are graphically represented?
(a) 2
(b) 3
(c) 4
(d) 5
(d) 5

Question 26.
Which is known as typical rectangular area in an application or a document?
(a) Window
(b) Icon
(c) Disk
(d) Drive
(a) Window

Question 27.
Which will display the name of the application and name of the document in the window?
(a) Title bar
(d) Scroll bar
(a) Title bar

Question 28.
Which key is pressed in the menus that appears underlined in the menu title?
(a) Ctrl key
(b) Alt key
(c) Shift key
(d) Home key
(b) Alt key

Question 29.
Which is the area in document window to type the text?
(a) Document window
(b) Application window
(c) Work space
(d) Desktop
(c) Work space

Question 30.
The smaller window, which is inside the application window is called the:
(a) document window
(b) application window
(c) work space
(d) desktop
(a) document window

Question 31.
The title bar will display the name of the:
(a) file
(b) document
(c) directory
(d) program
(b) document

Question 32.
Which bars are used to scroll the workspace horizontally or vertically?
(a) Title bar
(c) Scroll bar
(c) Scroll bar

Question 33.
Which changes to a double headed arrow when positioned over a border or a comer?
(a) Mouse pointer
(b) Enter key
(c) Arrow keys
(d) Mouse click
(a) Mouse pointer

Question 34.
Write the order from left to right in the taskbar contains:
(1) Network icon
(3) Default language
(4) Time and Date
(a) 1, 3, 4 and 2
(b) 3, 1, 2 and 4
(c) 1, 4, 3 and 2
(d) 1, 2, 3 and 4
(b) 3, 1, 2 and 4

Question 35.
Which icon is used by windows 8 and 10 instead of My computer icon?
(a) Computer icon
(b) PC icon
(c) This PC icon
(d) My system icon
(c) This PC icon

Question 36.
To quit an application of document click on:
(a) File → Exit
(b) File → Close
(c) ☒ Close button
(d) All the above
(d) All the above

Question 37.
Which is an in-built word processor application in windows OS?
(a) MS word
(c) Star writer
(d) Libre office writer

Question 38.
Which box on the start menu can be used to quickly search a particular folder or file in the computer?
(a) Search
(b) Find
(c) Seek
(d) Look in
(a) Search

Question 39.
Which is the most common way of opening a file or a folder?
(a) Open
(b) Double-click
(c) Click
(d) Right click
(b) Double-click

Question 40.
Which function key is used to change the file name or folder for selected?
(a) F1
(b) F2
(c) F3
(d) F4
(b) F2

Question 41.
Which combination of keys are used to select multiple files or folders?
(a) Alt + Click
(b) Alt + Enter
(c) Ctrl + Click
(d) Ctrl + Enter
(c) Ctrl + Click

Question 42.
Which keys are used to delete a file or folder permanently?
(a) Shift + Delete
(b) Shift + Enter
(c) Ctrl + Delete
(d) Ctrl + Enter
(a) Shift + Delete

Question 43.
Recycle bin is a:
(a) folder
(b) box
(c) drive
(d) program
(a) folder

Question 44.
Most often used folders and files may be created on the desktop in:
(a) Copy
(b) Send
(c) Shortcut
(d) Move
(c) Shortcut

Question 45.
Which button is used to switch to another user account on the computer without closing existing account?
(a) Switch user
(b) Log off
(c) Lock
(d) Sleep
(a) Switch user

Question 46.
Switch to another user account after closing all your open programs, if you do this:
(a) Switch user
(b) Log off
(c) Lock
(d) Sleep
(b) Log off

Question 47.
Puts the computer into a low-power mode after saving all running programs is:
(a) Hibernate
(b) Sleep
(c) Log off
(d) Lock
(a) Hibernate

Question 48.
Which is one of the popular Open Source versions of the UNIX operating system?
(a) LINUX
(b) MS-DOS
(c) Windows
(d) XENIX
(a) LINUX

Question 49.
Which OS is designed for computers, smartphones and network servers?
(a) MS-DOS
(b) Uhuntu
(c) Windows
(d) UNIX
(b) Uhuntu

Question 50.
When was Ubuntu OS conceived?
(a) 2001
(b) 2002
(c) 2003
(d) 2004
(d) 2004

Question 51.
Who was the successful entrepreneur of Ubuntu?
(a) Mark Shuttleworth
(b) Mark Wagh
(c) John Mauchly
(d) Engelbart
(a) Mark Shuttleworth

Question 52.
Which is the in-built email software in Ubuntu?
(a) Thunderbird
(b) Yahoo
(c) Gmail
(d) Hotmail
(a) Thunderbir

Question 53.
Which is the default desktop background or wallpaper in Ubuntu?
(a) Natural
(b) Ambiance
(c) Elephant
(d) Peacock
(b) Ambiance

Question 54.
Which is known as equivalent to taskbar in Ubuntu?
(a) Launcher
(b) Device
(c) Trash
(d) VBox
(a) Launcher

Question 55.
All current applications on your system will place an icon in the:
(a) Device
(b) Launcher
(c) Trash
(d) VBox
(b) Launcher

Question 56.
Which icon is equivalent of recycle bin of windows OS?
(a) Trash
(b) Device
(c) Launcher
(d) Vbox
(a) Trash

Question 57.
Match the following:

 (i) Windows series (a) For Apple phones, I – pad and I – pod. (ii) Android (b) For Desktop and Laptop computers (iii) iOS (c) For smart phones (iv) Linux (d) Open source Operating System for desktop and server.

(a) (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)
(b) (i) – (a); (ii) – (b); (iii) – (c); (iv) – (d)
(c) (i) – (b); (ii) – (a); (iii) – (c); (iv) – (d)
(d) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(a) (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)

Question 58.
Match the following:

 (i) Windows 3.x (a) 2001 (ii) Windows Me (b) 2006 (iii) Windows XP (c) 2000 (iv) Windows Vista (d) 1992

(a) (i) – (d); (ii) – (c); (iii) – (a); (iv) – (b)
(b) (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)
(c) (i) – (c); (ii) – (d); (iii) – (b); (iv) – (a)
(d) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)
(a) (i) – (d); (ii) – (c); (iii) – (a); (iv) – (b)

Question 59.
Choose the incorrect pair:

 Column – I Column – II (a) Windows NT Designed to act as servers in network. (b) Windows 8 Served as common platform for mobile and computer. (c) Windows 7 Multiple desktop (d) Windows XP Introduced 64 – bit processor.

(c)

Question 60.
Choose the correct pair:

 Column – I Column – II (a) Menu bar Displays the name of the application. (b) Work space Telps to drag and resize the windows. (c) Computer icon We can start any application. (d) Task bar Contains shortcuts to /various programs.

(d)

Question 61.
Choose the odd man out:
(a) Ctrl + X
(b) Ctrl + C
(c) Ctrl + S
(d) Ctrl + V
(c) Ctrl + S

Question 62.
Assertion (A):
Recycle bin is a special folder to keep the files or folders deleted by the user.
Reason (R):
We can still have an opportunity to recover them.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true, and R is the correct explanation for A.

Question 63.
Match the following:

 (i) Messaging indicator (a) To adjust the volume (ii) Sound indicator (b) Access instant messenger and email clients. (iii) Session indicator (c) Manages the network connections. (iv) Network indicator (d) Link to the system settings.

(a) (i) – (d); (ii) – (b); (iii) – (c); (iv) – (a)
(b) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)
(c) (i) – (a); (ii) – (b); (iii) – (c); (iv) – (d)
(d (i) – (b); (ii) – (c); (iii) – (a); (iv) – (d)
(b) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)

Question 64.
Identify the correct pair:

 Column – I Column – II (a) Libre office writer Similar to MS Excel (b) Libre office calc To prepare any presentation. (c) Trash Equivalent to Recycle bin. (d) Tool bar Contains Close, Minimize and Maximize buttons.

(c)

Question 65.
Identify the incorrect pair:

 Column – I Column – II (a) Launcher Provides easy access to applications. (b) Files Equivalent to My computer icon. (c) Software Icon To add any additional applications. (d) Menu bar Displays the current time.

(d)

Question 66.
Choose the odd man out.
(a) Libre office writer
(b) Libre office calc
(c) Libre office Impress
(d) MS power point
(d) MS power point

Question 67.
Assertion (A):
The Menu bar is located at the top of the screen.
Reason (R):
Network indicator manages network connections.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(b) Both A and R are true, but R is not the correct explanation for A.

Question 68.
From the options given below, choose the operations managed by the operating system.
(a) memory
(b) processes
(c) disks and I/O devices
(d) all of the above
(d) all of the above

Question 69.
Which is the default folder for many Windows Applications to save your file?
(a) My Document
(b) My Pictures
(c) Documents and Settings
(d) My Computer
(a) My Document

Question 70.
Under which of the following OS, the option Shift + Delete – permanently deletes a file or folder?
(a) Windows 7
(b) Windows 8
(c) Windows 10
(d) None of the OS
(a) Windows 7

Question 71.
What is the meaning of “Hibernate” in Windows XP/Windows 7?
(a) Restart the Computer in safe mode
(b) Restart the Computer in hibernate mode
(c) Shutdown the Computer terminating all the running applications
(d) Shutdown the Computer Without closing the running applications
(d) Shutdown the Computer Without closing the running applications

Question 72.
Which of the following OS is not based on Linux?
(a) Ubuntu
(b) Redhat
(c) CentOs
(d) BSD
(d) BSD

Question 73.
Which of the following in Ubuntu OS is used to view the options for the devices installed?
(a) Settings
(b) Files
(c) Dash
(d) VBox_GAs_5.2.2
(d) VBox_GAs_5.2.2

Question 74.
Identify the default email client in Ubuntu:
(a) Thunderbird
(b) Firefox
(c) Internet Explorer
(d) Chrome
(a) Thunderbird

Question 75.
Which is the default application for spreadsheets in Ubuntu? This is available in the software launcher.
(a) LibreOffice Writer
(b) LibreOffice Calc
(c) LibreOffice Impress
(b) LibreOffice Calc

Question 76.
Which is the default browser for Ubuntu?
(a) Firefox
(b) Internet Explorer
(c) Chrome
(d) Thunderbird
(a) Firefox

Question 77.
Where will you select the option to log out, suspend, restart, or shut down from the desktop of Ubuntu OS?
(a) Session Indicator
(b) Launcher
(c) Files
(d) Search
(a) Session Indicator

## TN State Board 11th Computer Science Important Questions Chapter 4 Theoretical Concepts of Operating System

Question 1.
What is a software?
A software is set of instructions that perform specific task. It interacts basically with the hardware to generate the desired output.

Question 2.
Mention the types of software.
Software is classified into two types:
(i) Application Software
(ii) System Software.

Question 3.
Define application software.
Application software is a set of programs to perform specific task. Eg: MS-Word is an application software to Create text document and VLC player is familiar application software to play audio, video files and many more.

Question 4.
Define system software.
System software is a type of computer program that is designed to run the computer’s hardware and application programs.
Eg: Operating System and Language Processor.

Question 5.
Define OS.
An Operating System (OS) is a system software Which serves as an interface . between a user and a computer.

Question 6.
Write the key features of the operating system.Answer:
The key features of the operating system are:

1. User Interface
2. Memory Management
3. Process Management
4. Security Management
5. Fault Tolerance
6. File Management.

Question 7.
What is the main objective of memory management?
The objective of Memory Management process is to improve both the utilization of the CPU and the speed of the computer ’s response to its users via main memory. The computers must keep several programs in main memory that associates with many different Memory Management schemes.

Question 8.
What is Garbage collection?
Allocation and de-allocation of memory blocks as needed by the program in main memory is called Garbage collection.

Question 9.
How the processes are classified?
A computer consists of a collection of processes, they are classified into two categories:

• Operating System proc|sses which is executed by system code.
• User Processes which is execute by user code.

Question 10.
Write the resources of a process.
A process needs certain resources including CPU time, memory, files and I/O devices to finish its task.

Question 11.
What is Round Robin Scheduling?
The Round Robin (RR) scheduling algorithm is designed especially for time sharing systems. Jobs (processes) are assigned and processor time in a circular method. Eg: Take three jobs A, B, C. First the job A is assigned to CPU then job B and job C and then again A, B and C and so on.

Question 12.
What is meant by fault tolerance?
The Operating Systems should be robust. When there is a fault, the Operating System should not crash, instead the Operating System have fault tolerance capabilities and retain the existing state of system.

Question 13.
List the prominent operating system.
Prominent OS are as follows:

• UNIX
• Microsoft Windows
• Linux
• iOS
• Android.

Question 14.
What is Unix?
UNIX is a family of multitasking, multi-user operating systems that derive originally from AT&T Bell Labs, where the development began in the 1970s by Ken Thompson and Dennis Ritchie.

Question 15.
What is iOS?
iOS (formerly iPhone OS) is a mobile Operating System created and developed by Apple Inc., exclusively for its hardware. It is the Operating System that presently powers many of the company’s mobile devices, including the iPhone, iPad and iPod Touch. It is the second most popular mobile Operating System globally after Android.

Question 16.
What is meant by Error Log File?
The user interface should reduce number of errors committed by the user with little practice the user should be in a position to avoid errors (Error Log File).

Question 17.
What is process?
A process is the unit of work (program) in a computer. A word-processing program being run by an individual user on a computer is a process. A system task, such as sending output to a printer or screen, can also be called as a Process.

Question 18.
Expand the following FAT and NTFS.
FAT – Be location Table.
NTFS – Nx Tgeneration Be System.

Question 19.
What are the popular operating systems used in personal computers and laptops?
Popular operating systems used in personal computers and laptops are:- Windows, UNIX and Linux.

Question 20.
What is the need of operating system?
It is an interface between the user and hardware.

Question 21.
Why operating system works as translator?
Operating system translates the user request into machine language (Binary language), processes it and then sends it back to operating systems.

Question 22.
Why is Linux called open source operating systems?
It can be modified and distributed by anyone around the world. The main advantage of Linux operating system is that it is open source. There are many versions and their updates. Most of the servers run on Linux because if is easy to customize.

Question 23.
Write the few different distributions of Linux?
Few different distributions of Linux are Ubuntu, Mint, Fedora, RedHat, Debian, Google’s Android, Chrome OS and Chromium OS.

Question 24.
What are the operating systems used in mobile devices?
Apple iOS and Google Android are the mobile operating systems.

Question 25.
What is a Android?
Android is a mobile operating system developed by Google, based on Linux and designed primarily for touch screen mobile devices such as smart phones and tablets.

Question 26.
What are the devices that uses Android operating system?
Android TV for televisions, Android Auto for cars and Android wear for wrist watches, each with a specialized user interface. It is also used on game consoles, digital cameras, PCs and other electronic gadgets.

Question 27.
Write the uses of operating system.
The main use of Operating System is

1. to ensure that a computer can be used do to exact if what the user wants it do.
2. easy interaction between the users and computers.
3. starting computer operation automati¬cally when power is turned on (Booting).
4. controlling Input and Output Devices.
5. manage the utilization of main memory.
6. providing security to user programs.

Question 28.
Mention the types of operating system.

1. Single user operating system
2. Multi-user operating system
3. Multi processing operating system
4. Time sharing operating system
5. Real time operating system
6. Distributed operating system
7. Interactive operating system.

Question 29.
How the operating system provides securities to the end user?
The Operating System provides three levels of securities to the user end.
They are
(i) File access level
(ii) System level
(iii) Network level.
(i) In order to access the files created by other people, one should have the access permission. Permissions can either be granted by the creator of the file or by the administrator of the system.
(ii) System level security is offered by the password in a multi-user environment. Both windows and Linux offer the password facility.
(iii) Network security is an indefinable one. So people from all over the world try to provide such a security.

Question 30.
Write short notes on time-sharing.
Time sharing is one of the features of Operating Systems. It allows execution of multiple tasks or processes concurrently. For each task a fixed time is allocated. This division of time is called Time- sharing. The processor switches rapidly between various processes after a time is elapsed or the process is completed.
Eg: Assume that there are three processes called P1, P2, P3 and time allocated for each process 30, 40, 50 minutes respectively. If the process PI completes within 20 minutes then processor takes the next process P2 for the execution. If the process P2 could not complete within 40 minutes, then the current process P2 will be paused and switch over to the next process P3.

Question 31.
Write the responsibilities of operating system in connection with memory management.
The Operating System is responsible for the following activities in connection with memory management:

1. Keeping track of which portion of memory are currently being used and who is using them.
2. Determining which processes (or parts of processes) and data to move in and out of memory.
3. Allocation and de-allocation of memory blocks as needed by the program in main memory. (Garbage Collection)

Question 32.
Write the responsibilities of operating system associated with the process management.
The Operating System is responsible for the following activities associated with the process management:

1. Scheduling processes and threads on the CPUs.
2. Creating and deleting both user and system processes.
3. Suspending and resuming processes.
4. Providing mechanisms for process synchronization.
5. Providing mechanisms for process communication.

Question 33.
Write short note on file management.
File management is an important function of OS which handles the data storage techniques. The operating System manages the files, folders and directory systems on a computer. Any type of data in a computer is stored in the form of files and directories/ folders through File Allocation Table (FAT). The FAT stores general information about files like filename, type (text or binary), size, starting address and access mode (sequential/ indexed/indexed-sequential/direct/relative).

Question 34.
What are the advantages of distributed operating system?
The advantages of distributed Operating System are as follows:

1. A user at one location can make use of all the resources available at another location over the network.
2. Many computer resources can be added easily in the network.
3. Improves the interaction with the customers and clients.
4. Reduces the load on the host computer.

Question 35.
Write short note on Linux.
Linux is a family of open-source operating systems. It can be modified and distributed by anyone around the world. This is different from proprietary software like Windows, which can only be modified by the company that owns it. The main advantage of Linux operating system is that it is open source. There are many versions and their updates. Most of the servers run on Linux because it is easy to customize.

Linux distributions: Linux mint, Fedora, Ubuntu, BOSS, Redhat.

Question 36.
Write in detail about memory management.
Memory Management is the process of controlling and coordinating computer’s main memory and assigning memory block (space) to various running programs to optimize overall computer performance. It involves the allocation of specific memory blocks to individual programs based on user demands. At the application level, memory management ensures the availability of adequate memory for each running program at all times.

The Operating System is responsible for the following activities in connection with memory management:
(i) Keeping track of which portion of memory are currently being used and who is using them.
(ii) Determining which processes (or parts of processes) and data to move in and out of memory.
(iii) Allocation and de-allocation of memory blocks as needed by the program in main memory. (Garbage Collection)

Question 37.
How will you classify the operating system?

Question 38.
What is a software? Explain the types of software?
A software is set of instructions that perform specific task. It interacts basically with the hardware to generate the desired output.
Types of Software: Software is classified into two types:
(i) Application Software,
(ii) System Software.

Application software is a set of programs to perform specific task.
Eg: MS – word is an application software to create text document and VLC player is familiar application software to play audio, video files and many more.

System software is a type of computer program that is designed to run the computer ’s hardware and application programs.
Eg: Operating System and Language Processor.

Question 39.
Explain in detail the User Interface (Ul) in operating system.
User interface is one of the significant feature in Operating System. The only way that user can make interaction with a computer. If the computer interface is not user-friendly, the user slowly reduces the computer usage from their normal life. This is a main reason for key success of GUI (Graphical User Interface) based Operating System.

The GUI is a window based system with a pointing device to direct I/O, choose from menus, make selections and a keyboard to enter text. Its vibrant colours attract the user very easily. Beginners are impressed by the help and pop up window message boxes. Icons are playing vital role of the particular application.

Now Linux distribution is also available as GUI based Operating System. The following points are considered when User Interface is designed for an application.
(i) The user interface should enable the user to retain this expertise for a longer time.
(ii) The user interface should also satisfy the customer based on their needs.
(iii) The user interface should save user’s precious time. Create graphical elements like Menus,Window,Tabs, Icons and reduce typing work will be an added advantage of the Operating System.
(iv) The ultimate aim of any product is to satisfy the customer. The User Interface is also to satisfy the customer.
(v) The user interface should reduce number of errors committed by the user with little practice the user should be in a position to avoid errors (Error Log File).

Question 40.
Explain the process management.
Process management is function that includes creating and deleting processes and providing mechanisms for processes to communicate and synchronize with each other. A process is the unit of work (program) in a computer. A word-processing program being run by an individual user on a computer is a process. A system task, such as sending output to a printer or screen, can also be called as a Process.
A computer consists of a collection of processes, they are classified as two categories:

(i) Operating System processes which is executed by system code.
(ii) User Processes which is execute by user code.
All these processes can potentially execute concurrently on a single CPU.
A process needs certain resources including CPU time, memory, files and I/O devices to finish its task.

The Operating System is responsible for the following activities associated with the process management:
(i) Scheduling processes and threads on the CPUs
(ii) Creating and deleting both user and system processes
(iii) Suspending and resuming processes
(iv) Providing mechanisms for process synchronization
(v) Providing mechanisms for process communication.

Question 41.
What are the advantages of memory management in Operating System?
Memory Management is the process of controlling and coordinating computer’s main memory and assigning memory block (space) to various running programs to optimize overall computer performance. It involves the allocation of specific memory blocks to individual programs based on user demands. At the application level, memory management ensures the availability of adequate memory for each running program at all times.

Question 42.
What is multi-user Operating system?
It is used in computers and laptops that allow same data and applications to be accessed by multiple users at the same time. The users can also communicate with each other. Eg: Windows, Linux and UNIX.

Question 43.
What is a GUI?
The Graphical User Interface is a type of user interface that allows users to interact with electronic devices through graphical icons and visual indicators such as secondary notation, instead of text-based user interfaces, typed command labels or text navigation.

Question 44.
List out different distributions of Linux operating system.
Different distributions of Linux are Linux Mint, Fedora, Ubuntu, BOSS, RedHat.

Question 45.
What are the security management features available in Operating System?
The Operating System provides three levels of securities to the user end. They are

• File access level
• System level
• Network level.

Question 46.
What is multi-processing?
Multi-processing is one of the features of Operating System. It has two or more processors for a single running process (job). Processing takes place in parallel is known as parallel processing. Each processor works on different parts of the same task or on two or more different tasks.

Question 47.
What are the different Operating Systems used in computer?
Operating Systems used in personal computers and laptops are Windows, UNIX and Linux. The mobile devices mostly use Android and iOS as mobile OS.

Question 48.

1. Provides the advantage of quick response.
2. Avoids duplication of software.
3. Reduces CPU idle time.
4.  It can execute tasks simultaneously.

1. Problem of data communication and security.
2. Problem of reliability.

Question 49.
Explain and List out examples of mobile operating system.
Mobile devices such as phones, tablets and MP3 players are different from desktop and laptop computers and hence they need special Operating Systems.
Eg: Apple iOS and Google Android.

Android:
It is a mobile operating system developed by Google, based on Linux and designed primarily for touch screen mobile devices such as smart phones and tablets. Google has developed Android TV for televisions, Android Auto for cars and Android Wear for wrist watches, each with a specialized user interface. Android are also used on game consoles, digital cameras, PCs and other electronic gadgets.

iOS-iPhone OS:
iOS (formerly iPhone OS) is a mobile Operating System created and developed by Apple Inc., exclusively for its hardware. It is the Operating System that powers many of the company’s mobile devices, including the iPhone, iPad and iPod Touch. It is the second most popular mobile Operating System globally after Android.

Question 50.
What are the differences between Windows and Linux Operating system?

 Windows Linux Microsoft Windows is a family of proprietary operating system. Linux is a family of open source operating system. It is a user interface. It is a command line access. It can only be modified by the company that owns it. It can be modified and distributed by anyone around the world.

Question 51.
Explain the process management algorithms in Operating System.
The following algorithms are mainly used to allocate the job (process) to the processor,
(i) FIFO
(ii) SJF
(iii) Round Robin
(iv) Based on Priority.
(i) FIFO (First In First Out) Scheduling:
The process that enters the queue first is executed first by the CPU, followed by the next and so on. The processes are executed in the order of the queue (row).

(ii) SJF (Shortest Job First) Scheduling:
This algorithm works based on the size of the job being executed by the CPU. Consider two j obs A and B.
(a) A = 6 kilo bytes, (b) B = 9 kilo bytes First the job “A” will be assigned and then job “B” gets its turn.

(iii) Round Robin Scheduling:
This algorithm is designed especially for time sharing systems. Jobs (processes) are assigned and processor time in a circular method. Take three jobs A, B, C. First the job A is assigned to CPU then job B and job C and then again A, B and C and so on.

(iv) Based On Priority:
The given job (process) is assigned based on a Priority. The job which has higher priority is more important than other jobs. Eg: Take two jobs A and B. Let the priority of A be 5 and priority B be 7.
Job B is assigned to the processor before job A.

Question 52.
Explain the concept of a Distributed Operating System.
The distributed operating system takes care of the data and application that are stored and processed on multiple physical locations across the world over the digital network (internet/intranet). The Distributed Operating System is used to access shared data and files . that reside in any machine around the world. The user can handle the data from different locations. The users can access as if it is available on their own computer.
The advantages of distributed Operating System are as follows:
(i) A user at one location can make use of all the resources available at another location over the network.
(ii) Many computer resourcgs can be added easily in the network.
(iii) Improves the interaction with the customers and clients.
(iv) Reduces the load on the host computer.

Question 53.
Explain the main purpose of an operating system.
In earlier day’s user had to design the application to the internal structure of the hardware. Operating system was needed to enable the user to design the application without the knowledge of the computer’s internal structure and hardware system.

Nowadays, user needs an interface to interact with the computer and controls the execution of all kinds of programs without knowing the internals of the hardware.
Usage of Operating system:
(i) Easy interaction between the human and computer.
(ii) Starting computer operation automatically when power is turned on.
(iv) Controlling input and output devices.
(v) Managing use of main memory.
(vi) Providing security to users program.

Question 54.

1. It is cheaper.
2. It is high quality.
3.  Open source operating system is very reliable.
4. Help us become more flexible.
5. Creativity.

1. Vulnerable to malicious users.
2. It is not always user-friendly.
3. Personalized support is rarely available.
4. Institutional and organizational procurement process affecting the decision making process.

Question 1.
__________ is set of instructions that perform specific test.
(a) Software
(b) Hardware
(c) Instruction
(d) Data
(a) Software

Question 2.
There are _____ types of software.
(a) 2
(b) 3
(c) 4
(d) 6
(a) 2

Question 3.
__________ is a set of programs to perform specific task.
(a) Software
(b) System software
(c) Application software
(d) Hardware
(c) Application software

Question 4.
__________ is an application software.
(a) Linux
(b) Unix
(c) MS-Word
(d) Windows
(c) MS-Word

Question 5.
________ is an system software:
(a) Windows
(b) MS-Word
(c) MS-Excell
(d) Lotus
(a) Windows

Question 6.
An operating system allows only a single user to perform a task at a time is called as a:
(a) single user operating system
(b) multi-user operating system
(c) time sharing
(d) distributed operating system
(a) single user operating system

Question 7.
The operating system provides levels of securities to the end user.
(a) four
(b) five
(c) six
(d) three
(d) three

Question 8.
The expansion of FIFO is
(a) First In First Out
(b) Fast In Fast Out
(c) Fast In First Out
(d) First In Fast Out
(a) First In First Out

Question 9.
The expansion of SJF is
(a) Slower Job First
(b) Slower Job Front
(c) Shortest Job First
(d) Shortest Job Front
(c) Shortest Job First

Question 10.
________ Security is offered by the password in a multi-user environment:
(a) System level
(b) File level
(c) Network level
(d) Software level
(a) System level

Question 11.
The Linux operating system was originated in the year:
(a) 1991
(b) 1997
(c) 1980
(d) 1993
(a) 1991

Question 12.
__________ is an example for a single user operating system:
(a) Windows
(b) Linux
(c) Unix
(d) MS-Dos
(d) MS-Dos

Question 13.
_______ management is the process of controlling and coordinating computer’s main memory:
(a) Memory
(b) Process
(c) Security
(d) Fault tolerance
(a) Memory

Question 14.
The __________ operating system is used to access shared data and files that residue in any machine around the world:
(a) multiuser
(b) single user
(c) distributed
(d) time sharing
(c) distributed

Question 15.
The ________ scheduling algorithm is designed especially for time sharing system:
(a) FIFO
(b) SJF
(c) Round Robin
(d) Based on priority
(c) Round Robin

Question 16.
iOS was created and developed by:
(a) Apple Inc
(b) IBM
(c) Apple iOS
(d) Microsoft
(a) Apple Inc

Question 17.
__________ is a computer related mistake.
(a) Data
(b) Program
(c) File
(d) Error
(d) Error

Question 18.
An example of a single user and single task operating system is:
(a) MS-DOS
(b) UNIX
(c) Windows
(d) Linux
(a) MS-DOS

Question 19.
An example of a multi user and multi task operating system:
(a) MS-DOS
(b) UNIX
(c) Windows
(d) Both (b) and (c)
(d) Both (b) and (c)

Question 20.
Memory management is the process of controlling and co-ordinating:
(a) Operating system
(b) Application software
(c) Main memory
(d) Devices
(c) Main memory

Question 21.
How many categories are classified by the collection of process?
(a) 1
(b) 2
(c) 3
(d) 4
(b) 2

Question 22.
Which is based on queuing technique?
(a) FIFO
(b) SJF
(c) Round Robin
(d) Based on Priority
(a) FIFO

Question 23.
Which scheduling works based on the size . of the job being executed by the CPU?
(a) FIFO
(b) SJF
(c) Round Robin
(d) Based on Priority
(b) SJF

Question 24.
Which security is an indefinable one?
(a) Network level
(b) System level
(c) File level
(d) Process level
(a) Network level

Question 25.
Which is one of the feature of operating system that allows execution of multiple tasks?
(a) File management
(b) Time sharing
(c) Memory management
(d) Process management
(b) Time sharing

Question 26.
Which is used to access shared data and files that reside in any computer around the world?
(a) Single user operating system
(b) Multi user operating system
(c) Distributed operating system
(d) Mobile operating system
(c) Distributed operating system

Question 27.
Which is a family of multitasking and multi-user operating systems?
(a) MS-DOS
(b) DOS
(c) CP / M
(d) UNIX
(d) UNIX

Question 28.
UNIX was developed by:
(a) Ken Thompson
(b) Dennis Ritchie
(c) Thomas wood
(d) Both (a) and (b)
(a) Ken Thompson

Question 29.
Which is called family of open-source operating systems?
(a) LINUX
(b) MS-DOS
(c) DOS
(d) Windows
(a) LINUX

Question 30.
Linux operating system is similar to:
(a) MS-DOS
(b) UNIX
(c) DOS
(d) Windows
(b) UNIX

Question 31.
Which is a windows alternative open source operating system?
(a) React OS
(b) LINUX
(c) UNIX
(d) MS-DOS
(a) React OS

Question 32.
Who developed Android mobile operating system?
(a) Wipro
(b) Microsoft
(c) IBM

Question 33.
Which is the second most popular mobile operating system globally after Android?
(a) UNIX
(b) LINUX
(c) iOS
(d) BOSS
(a) UNIX

Question 34.
Match the following:

 (a) Allocation and de – allocation of memorv blocks (i) Process management (b) Round Robin (ii) Multi Drocessine (c) File access level (iii) Memory management (d) Two or more processors for a single running process (iv) Security management

(a) (iii), (i), (iv), (ii)
(b) (i), (iv), (ii), (iii)
(c) (iii), (iv), (i), (ii)
(d) (ii), (iii), (iv), (i)
(a) (iii), (i), (iv), (ii)

Question 35.
Match the following:

 (i) Application Software (a) Assigning memory blocks to various running programs. (ii) System Software (b) A set of programs to perform specific task. (in) Operating System (c) Designed to run the computers hardware and application program. (iv) Memory Management (d) Interface between a user and a computer.

(a) (i) – (a); (ii) – (b); (iii) – (c); (iv) – (d)
(b) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)
(c) (i) – (c); (ii) – (b); (iii) – (a); (iv) – (d)
(d) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(b) (i) – (b); (ii) – (c); (iii) – (d); (iv) – (a)

Question 36.
Find the odd man out:
(a) FIFO
(b) SJF
(c) Android
(d) Round Robin
(c) Android

Question 37.
Find the odd man out:
(a) Unix
(b) Linux
(c) iOS
(d) Fault Tolerance
(d) Fault Tolerance

Question 38.
Choose the correct pair.

 Column – I Column – II (a) FIFO Size of the job (b) SJF Queuing technique (c) Multi – processing Provides security to the end user. (d) Time – sharing Allows execution of multiple tasks or process concurrently.

(d)

Question 39.
Identify the odd man out:
(a) Alpha
(b) Donut
(c) Froyo
(d) Mint
(d) Mint

Question 40.
Choose the incorrect pair.

 Column – I Column – II (a) Memory Management Controlling and coordinating computer’s main memory (b) Process Management Function that includes creating and deleting process (c) File Management Handles the data storage techniques (d) Time Sharing Data and application are stored and processed on multiple physical locations across the world.

(d)

Question 41.
Assertion (A):
Linux is a family of proprietary operating system.
Reason (R):
It can be modified and distributed by anyone around the world.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(d) A is false, but R is true.

Question 42.
Assertion (A):
Modem operating system use a Graphical User Interface (GUI).
Reason (R):
A GUI lets us use mouse to click icons, buttons, menus and everything clearly displayed on the screen.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true, and R is the correct explanation for A.

Question 43.
Operating system is a:
(a) application software
(b) hardware
(c) system software
(d) component
(c) system software

Question 44.
Identify the usage of operating systems:
(a) easy interaction between the human and computer
(b) controlling input and output Devices
(c) managing use of main memory
(d) all the above
(d) all the above

Question 45.
Which of the following is not a function of an Operating System?
(a) Process Management
(b) Memory Management
(c) Security management
(d) Compiler Environment
(d) Compiler Environment

Question 46.
Which of the following OS is a Commercially licensed Operating system?
(a) Windows
(b) UBUNTU
(c) FEDORA
(d) REDHAT
(a) Windows

Question 47.
Which of the following Operating systems support Mobile Devices?
(a) Windows 7
(b) Linux
(c) BOSS
(d) iOS
(d) iOS

Question 48.
File Management manages:
(a) files
(b) folders
(c) directory systems
(d) all the above
(d) all the above

Question 49.
Interactive Operating System provides:
(a) Graphics User Interface (GUI)
(b) Data Distribution
(c) Security Management
(d) Real Time Processing
(a) Graphics User Interface (GUI)

Question 50.
Android is a:
(a) Mobile Operating system
(b) Open Source
(d) All the above
(d) All the above

Question 51.
Which of the following refers to Android operating system’s version?
(a) JELLY BEAN
(b) UBUNTU
(c) OS/2
(d) MITTIKA
(a) JELLY BEAN

## TN State Board 11th Computer Science Important Questions Chapter 3 Computer Organization

Question 1.
Define computer organisation.
Computer organization deals with the hardware components of a computer system. It includes input/output devices, the central processing unit, storage and primary memory. It is concerned with how the various components of computer hardware operate. It also deals with how they are interconnected to implement an architectural specification.

Question 2.
Define instruction set.
A command which is given to a computer to perform an operation on data is called an instruction. Basic set of machine level instructions that a microprocessor is designed to execute is called as an instruction set.

Question 3.
What do you mean by word size?
The number of bits that can be processed by a processor in a single instruction is called its word size. Word size determines the amount of RAM that can be accessed by a microprocessor. Total number of input and output pins in turn determines the architecture of the microprocessor.

Question 4.
Define bus.
A bus is a collection of wires used for communication between the internal components of a computer.

Question 5.
What is decoder?
A decoder is a digital circuit that is used to point to the specific memory location where the word can be located.

Question 6.
The read operation transfers the data (bits) from memory word to memory data register.

Question 7.
What is write operation?
The write operation transfers the data (bits) from memory data register to word.

Question 8.
What criteria microprocessors are classified?
Microprocessors are classified based on the following criteria:
(i) The width of data that can be processed.
(ii) The instruction set.

Question 9.
What is USB 3.0?
USB 3.0 is the third major version of the Universal Serial Bus (USB) standard to connect computers with other electronic gadgets. It can transfer data up to 5 Giga byte/second. USB 3.1 and USB 3.2 are also released.

Question 10.
What are the two basic types of RAM?
There are two basic types of RAM. They are
(i) Dynamic RAM (DRAM)
(ii) Static RAM (SRAM)

Question 11.
What is Access time?
Access time is the time delay or latency between a request to an electronic system, and the access being completed or the requested data returned.

Question 12.
What is a computer memory?
Computer memory is the storage space in the computer, where data and instructions are stored. Sequential access and random access are the two types of accessing methods to access (store or retrieve) the memory. In sequential access, the memory is accessed in an orderly manner from starting to end. In random access, any byte of memory can be accessed directly without navigating through previous bytes.

Question 13.
What is a system bus?
The system bus is a bunch of wires which is the collection of address bus, data bus and control bus.

Question 14.
What do you understand by the word microprocessor?
The microprocessor is a programmable multipurpose silicon chip. It is driven by clock pulses. It accepts input as a binary data and after processing, it provides the output data as per the instructions stored in the memory.

Question 15.
What is meant by Hertz?
Hertz (Hz) is the standard unit of measurement used for measuring frequency. Frequency is measured in cycles per second, one hertz equals one cycle per second.

Question 16.
What is called clock speed?
The speed at which the microprocessor executes instructions is called the clock speed. Clock speed is measured in MHz (Mega Hertz) or in GHz (Giga Hertz).

Question 17.
How the word size is determined?
It determines the amount of RAM that can be accessed by a microprocessor at one time and the total number of pins on the microprocessor. Total number of input and output pins in turn determines the architecture of the microprocessor.

Question 18.
Why is top surface of the EPROM chip is covered by stickers?
EPROM chips have a transparent area at the top surface which is covered by stickers. If it gets removed, the ultraviolet light in the sunlight may erase the contents.

Question 19.
What do you understand about cache memory?
It is a very high speed and expensive memory, which is used to speed up the memory retrieval process.

Question 20.
What do you understand by backup storage?
Secondary storage devices serve as a supportive storage to main memory and they are non-volatile in nature,
secondary storage is also called as backup storage.

Question 21.
What are the areas that can use flash memories?
Flash memories can be used in personal computers, personal digital assistants (PDA), digital audio players, digital cameras and mobile phones.

Question 22.
What are the uses of Blu-ray disc?
It enables recording, rewriting and playback of high-definition video and storing large amount of data.

Question 23.
What is the use of MDR?
The memory Data Register (MDR) keeps the data which is transferee! between the memory and the CPU.

Question 24.
What is microprocessor? Draw the block diagram of microprocessor.
The microprocessor is a programmable multipurpose silicon chip that is based on a register. It is driven by clock pulses. It accepts input as a binary data and after processing, it provides the output data as per the instructions stored in the memory.

Question 25.
Write short notes on DVD.
A DVD (Digital Versatile Disc or Digital Video Disc) is an optical disc capable of storing up to 4.7 GB of data, more than six times what a CD can hold. They are often used to store movies at a better quality. Like CDs, DVDs are read with a laser.

The disc can have one or two sides, and one or two layers of data per side; the number of sides and layers determines how much it can hold. A 12 cm diameter disc with single sided, single layer has 4.7 GB capacity, whereas the single sided, double layer has 8.5 GB capacity. The 8 cm DVD has 1.5 GB capacity.

The capacity of a DVD-ROM can be visually determined by noting the number of data sides of the disc. Double-layered sides are usually gold- coloured, while single-layered sides are usually silver-coloured, like a CD.

Question 26.
Write short notes on Blu-ray Disc.
Blu-Ray Disc is a high-density optical disc similar to DVD. It is used for PlayStation games and for playing high-definition (HD) movies. A double-layer BIu-Ray disc can store up to 50GB (gigabytes) of data. This is more than 5 times the capacity of a DVD, and above 70 times of a CD.

The format was developed to enable recording, rewriting and playback of high-definition video, as well as storing large amount of data. DVD uses a red laser to read and write data. Blu-ray uses a blue-violet laser to write. Hence, it is called as Blu-Ray.

Question 27.
What are the methods to access the memory? Draw the Memory Hierarchy.
There are two types of accessing methods to access (read or write) the memory. They are sequential access and random access. In sequential access, the memory is accessed in an orderly manner from starting to end. But, in random access, any byte of memory can be accessed directly without navigating through previous bytes.
→ refer figure no. 3.4.

Question 28.
Differentiate static RAM and Dynamic RAM.

 Static RAM Dynamic RAM It needs to be refreshed less often. It needs to be refreshed frequently. It is more expensive. It is less expensive. It uses transistor to store a single bit of data. It uses a separate capacitor to store each bit of data. It is used in cache memory. It is used in main memory.

Question 29.
What are the three main units of microprocessor?
The microprocessor is made up of 3 main units. They are-
(i) Arithmetic and Logic unit (ALU):
To perform arithmetic and logical instructions based on computer instructions.

(ii) Control unit:
To control the overall operations of the computer through signals.

(iii) Registers (Internal Memory):
They are used to hold the instruction and data for the execution of the processor.

Question 30.
List down the types of operations that carried out by the instruction set.

• Data transfer
• Arithmetic operations
• Logical operations
• Control flow
• Input / output

Question 31.
Explain in detail the various types of storage devices.
Secondary Storage Devices:
The secondary storage devices are used to store data that is of larger size which can be accessed later. Since the main memory is costly, the size is generally very limited in a computer. A portion of a secondary storage which can serve as an extension of the main memory and can perform its job is called as virtual memory.

Hard Disks:
Hard disk is a magnetic disk on which you can store computer data. Hard disks can store more data and are faster than floppy disks. A hard disk cqtn store from 10 megabytes to several gigabytes, whereas most floppies have a maximum storage capacity of 1.4 megabytes. Hard disks are less portable than floppies, although it is possible to port by removable hard disks. There are two types of removable hard disks: disk packs and removable cartridges.

Compact Disc (CD):
A CD or CD-ROM is made from 1.2 millimeters thick, polycarbonate plastic material. A thin layer of aluminum or gold is applied to the surface. CD data is represented as tiny indentations known as “pits”, encoded in a spiral track moulded into the top of the polycarbonate layer. The areas between pits are known as “lands”. A motor within the CD player rotates the disk. The capacity of an ordinary CD-ROM is 700MB.

Digital Versatile Disc (DVD):
A DVD (Digital Versatile Disc or Digital Video Disc) is an optical disc capable of storing up to 4.7 GB of data, more than six times what a CD can hold. DVDs are often used to store movies at a better quality than with a VHS. They can also have interactive menus and bonus features such as deleted scenes and commentaries. Like CDs, DVDs are read with a laser.

The disc can have one or two sides, and one or two layers of data per side; the number of sides and layers determines how much it can hold. A 12 cm diameter disc with single sided, single layer has 4.7 GB capacity, whereas the single sided, double layer has 8.5 GB capacity. The 8 cm DVD has 1.5 GB capacity.

The capacity of a DVD-ROM can be visually determined by noting the number of data sides of the disc. Double-layered sides are usually gold- coloured, while single-layered sides are usually silver-coloured, like a CD.

Flash Memory Devices:
It is an electronic (solid-state) non-volatile computer storage medium that can be electrically erased and
reprogrammed. They are either EEPROM or EPROM. Eg: Pendrives, memory cards etc. Flash memories can be used in personal computers, Personal Digital Assistants (PDA), digital audio players, digital cameras and mobile phones. Flash memory offers fast access times. The time taken to read or write a character in memory is called access time. The capacity of the flash memories vary from 1 Gigabytes (GB) to 2 Terabytes (TB).

Blu-Ray Disc:
It is a high-density optical disc format similar to DVD. Blu-ray is used for Play station games and for playing high-definition (HD) movies. A double¬layer Blu-Ray disc can store up to 50GB (gigabytes) of data. This is more than 5 times the capacity of a DVD, and above 70 times of a CD.

The format was developed to enable recording, rewriting and playback of high-definition video (HD), as well as storing large amounts of data. DVD uses a red laser to read and write data. Blu-ray uses a blue-violet laser to write. Hence, it is called as Blu-Ray.

Question 32.
What are the parameters which influence the characteristics of a microprocessor?
A Microprocessor’s performance depends on the following characteristics:

• Clock speed
• Instruction set
• Word size.

Question 33.
What is an instruction?
A command which is given to a computer to perform an operation on a piece of data is called an instruction.

Question 34.
What is a program counter?
The Program Counter (PC) is a special register in the CPU which always keeps the address of the next instruction to be executed.

Question 35.
What is HDMI?
High-Definition Multimedia Interface is an audio/video interface which transfers the uncompressed video and audio data from a video controller, to a compatible computer monitor, LCD projector, digital television etc.

Question 36.
Which source is used to erase the content of a EPROM?
Erasable Programmable Read Only Memory is a special type of memory which serves as a PROM, but the content can be erased using ultraviolet rays. EPROM retains its contents until it is exposed to ultraviolet light. The ultraviolet light clears its contents, making it possible to reprogram the memory.

Question 37.
Differentiate Computer Organisation from Computer Architecture.

 Computer Organisation Computer Architecture Computer organisation deals with the hardware components of a computer system. It includes input / output devices, the central processing unit, storage and primarv memory. Computer architecture deals with the engineering considerations involved in designing a computer.

Question 38.
Classify the microprocessor based on the size of the data.
Depending on the data width, microprocessors can process instructions. The microprocessors can be classified as follows:

• 8-bit microprocessor
• 16-bit microprocessor
• 32-bit microprocessor
• 64-bit microprocessor.

Question 39.
Write down the classifications of microprocessors based on the instruction set.
Reduced Instruction Set Computers (RISC):
They have a small set of highly optimized instructions. Complex instructions are also implemented using simpler instructions, thus reducing the size of the instruction set. Eg: RISC processors are Intel P6, Pentium IV, AMD K6 and K7.

Complex Instruction Set Computers (CISC):
They support hundreds of instructions. Computers supporting CISC can accomplish a wide variety of tasks, making them ideal for personal computers.
Eg: CISC processors are Intel 386 & 486, Pentium, Pentium II and III, and Motorola 68000.

Question 40.
Differentiate PROM and EPROM.

 PROM EPROM PROM is a memory on which data can be written only once. EPROM is a memory on which ultra violet rays are used to clear its contents and making it possible to reprogram the memory.

Question 41.
Write down the interfaces and ports available in a computer.

Serial Port:
To connect the external devices, found in old computers.

Parallel Port:
To connect the printers, found in old computers.

USB Ports:
To connect external devices like cameras, scanners, mobile phones, external hard disks and printers to the computer. USB 3.0 is the third major version of the Universal Serial Bus (USB) standard to connect computers with other electronic gadgets. USB 3.0 can transfer data up to 5 Giga byte/second. USB 3.1 and USB 3.2 are also released.

VGA Connector:
To connect a monitor or any display device like LCD projector.

Audio Plugs:
To connect sound speakers, microphone and headphones.

PS/2 Port:
To connect mouse and keyboard to PC.

SCSI Port:
To connect the jtard disk drives and network connectors.

High Definition Multimedia Interface (HDMI):
It is an audio/video interface which transfers the uncompressed video and audio data from a video controller, to a compatible computer monitor, LCD projector, digital television etc.

Question 42.
Differentiate CD and DVD.

 CD DVD CD stands for Compact Disk. DVD stands for Digital Versatile Disc. CDs are made with the purpose of holding audio files as well as program files. DVDs are made with the purpose of holding video files, movies, substantial amount of programs etc. A standard CD can store about 700 MB of data. A standard DVD can hold 4.7 GB of data.

Question 43.
How will you differentiate a flash memory and an EEPROM?

 Flash Memory EEPROM The flash memory allows data to be written or erased in blocks. The       EEPROM requires data to be written or erased one bvte at a time. Flash memory is faster in performance. EEPROM is slower in performance. It uses NAND type memory. It uses NOR type memory.

Question 44.
Explain the characteristics of a micro processor.
A Microprocessor’s performance depends on the following characteristics:
(i) Clock speed
(ii) Instruction set
(iii) Word size.

(i) Clock Speed:
Every microprocessor has an internal clock that regulates the speed at which it executes instructions. The speed at which the microprocessor executes instructions is called the clock speed. Clock speed is measured in MHz (Mega Hertz) or in GHz (Giga Hertz).

Instruction Set:
A command which is given to a computer to perform an operation on data is called an instruction. Basic set of machine level instructions that a microprocessor is designed to execute is called as an instruction set This instruction set carries Data transfer, Arithmetic operations, Logical operations, Control flow, Input/output operations.

(iii) Word Size:
The number of bits that can be processed by a processor in a single instruction is called its word size. Word size determines the amount of RAM that can be accessed by a microprocessor at one time and the total number of pins on the microprocessor. Total number of input and output pins in turn determines the architecture of the microprocessor.

Question 45.
How the read and write operations are performed by a processor? Explain.
The read operation fetches data from memory and transfers to MDR. A single control line performs two operations like Read / Write using 1 or 0. The write operation transfers data from the MDR to memory. This organisation is shown below in figure.

The word in the RAM has the same size (no. of bits) as the Memory Data Register (MDR). If the processor is an 8-bit processor like Intel 8085, its MDR and the word in the RAM both have 8 bits. If the size of the MDR is eight bits, which can be connected with a word of eight bits where the data can be stored or retrieved, the data bus has eight wires in parallel to transfer the data in any one direction which depends on whether the control is read or write.

This control line is labeled as R/W, which becomes 1 means READ operation and 0 means WRITE operation. Figure shows the content of MDR and the Memory Word before the READ operation. Also Figure shows the content of MDR and the Memory Word after the READ operation.read operation transfers the data (bits) from word to memory data register. The write operation transfers the data (bits) from memory data register to word.

Question 46.
Arrange the memory devices in ascending order based on the access time.

Cache memory:
The cache is a very hi§h speed, expensive piece of memory, which is used to speed up the memory retrieval process. The idea of introducing a cache is that, this extremely fast memory would store data that is frequently accessed and if possible, the data that is spatially closer to it. This helps to achieve the fast response time.

Random-access memory / main memory:
RAM is a volatile memory, which means that the information stored in it is not permanent. When the power is turned off, whatever data that resided in a RAM is lost. It allows both read and write operations.

Hard Disk:
Hard disk a ma§netic disk on which we can store computer data. Hard disks are less portable than floppies, although it is possible to port by removable hard disks. Disk packs and removable cartridges are the two types of removable hard disks.

Compact disk:
A CD or CD-ROM is made from 1.2 millimeters thick, polycarbonate plastic material. A thin layer of aluminium or gold is applied to the surface. CD data is represented as tiny indentations known as “pits”, encoded in a spiral track moulded into the top of the polycarbonate layer. The areas between pits are known as “lands”. A motor within the CD player rotates the disk. The capacity of an ordinary CD-ROM is 700MB.

Digital Versatile Disc (DVD):
A DVD (Digital Versatile Disc or Digital Video Disc) is an optical disc capable of storing up to 4.7 GB of data, more than six times what a CD can hold. DVDs are often used to store movies at a better quality. Like CDs, DVDs are read with a laser.

Question 47.
Explain the types of ROM.
It refers to special memory in a computer with pre-recorded data at manufacturing time which cannot be modified. The stored programs that start the computer and perform diagnostics are available in ROMs. ROM stores critical programs such as the program that boots the computer. Once the data has been written onto a ROM chip, it cannot be modified or removed and can only be read. ROM retains its contents even when the computer is turned off. So, ROM is called as a non¬volatile memory.

It is also a non-volatile memory on which data can be written only once. Once a program has been written onto a PROM, it remains there forever. Unlike the main memory, PROMs retain their contents even when the computer is turned off.

The PROM differs from ROM. PROM is manufactured as a blank memory, whereas a ROM is programmed during the manufacturing process itself. PROM programmer or a PROM burner is used to write data to a PROM chip. The process of programming a PROM is called burning the PROM.

It is a special type of memory which serves as a PROM, out the content can be erased using ultraviolet rays. EPROM retains its contents until it is exposed to ultraviolet light. The ultraviolet light clears its contents, making it possible to reprogram the memory.

An EPROM differs from a PROM, PROM can be written only once and cannot be erased. EPROMs are used widely in personal computers because they enable the manufacturer to change the contents of the PROM to replace with updated versions or erase the contents before the computer is delivered.

Electrically Erasable Programmable Read Only Memory is a special type of PROM that can be erased by exposing it to an electrical charge. Like other types of PROM, EEPROM retains its contents even when the power is turned off. Comparing with all other types of ROM, EEPROM is slower in performance.

Question 1.
Which type of integrated circuit were introduced in early 1970s?
(a) Microprocessor
(b) Pentium
(c) Intel
(d) AMD
(a) Microprocessor

Question 2.
Which is the first microprocessor developed by Intel Inc?
(a) 8008
(b) 4004
(c) 8086
(d) 8085
(b) 4004

Question 3.
What is the standard unit of speed measurement used for measuring frequency?
(a) Watt
(b) Speed
(c) Hertz
(d) Meter
(c) Hertz

Question 4.
One hertz equals:
(a) one cycle per second
(b) one cycle per minute
(c) one cycle per hour
(d) one cycle per year
(a) one cycle per second

Question 5.
Which regulates the speed and executes instructions in every microprocessor?
(a) Instruction set
(b) Internal clock
(c) Clock speed
(d) Control flow
(b) Internal clock

Question 6.
What is the unit of measuring clock speed?
(a) MHz (Mega Hertz)
(b) GHz (Giga Hertz)
(c) Speed
(d) Both (a) and (b)
(d) Both (a) and (b)

Question 7.
Which command is given to a computer to perform an operation on data?
(a) Instruction
(b) Data
(c) Program
(d) Operation
(a) Instruction

Question 8.
What is called a basic set of machine level instructions that a microprocessor is designed to execute?
(a) Instruction set
(b) Internal clock
(c) Internal memory
(d) Frequency
(a) Instruction set

Question 9.
Which keeps the data that is transferred between the memory and the CPU?
(a) RAM
(b) Data transfer
(c) Instruction
(d) Memory Data Register
(d) Memory Data Register

Question 10.
What is the special register which always keeps the address of next instruction to be executed?
(a) Program counter
(b) Data transfer
(c) Memory Register
(d) Memory Data Register
(a) Program counter

Question 11.
What is called a collection of wires used for communication between internal components of the computer?
(a) Memory
(b) Data
(c) Bus
(d) Processor
(c) Bus

Question 12.
Which digital circuit is used to point to the specific memory location where the word can be located?
(a) Instruction
(b) Decoder
(c) Compiler
(d) Interpreter
(b) Decoder

Question 13.
Which operation is transfers the data from word to Memory Data Register?
(b) Write
(c) Copy
(d) Move

Question 14.
Which operation transfers the data from Memory Data Register to word?
(b) Write
(c) Copy
(d) Move
(b) Write

Question 15.
RISC stands for:
(a) Reduced Instruction Set Computers
(b) Replaced Instruction Set Computers
(c) Resolved Instruction Set Computers
(d) Recalled Instruction Set Computers
(a) Reduced Instruction Set Computers

Question 16.
Which of the following is RISC processor?
(a) Pentium IV
(b) Intel P6
(c) AMD K7
(d) All the above
(d) All the above

Question 17.
CISC stands for:
(a) Completed Instruction Set Computers
(b) Complex Instruction Set Computers
(c) Compiled Instruction Set Computers
(d) Copied Instruction Set Computers
(b) Complex Instruction Set Computers

Question 18.
Which of the following is CISC processor?
(a) Intel 386
(b) Pentium
(c) Motorola 68000
(d) All the above
(d) All the above

Question 19.
How many types of accessing methods are used to access the memory?
(a) 2
(b) 3
(c) 4
(d) 5
(a) 2

Question 20.
The memory is accessed in an orderly manner from starting to end in:
(a) Sequential access
(b) Random access
(c) Directly access
(d) All the above
(a) Sequential access

Question 21.
The memory is accessed directly without navigating through previous bytes is:
(a) Sequential access
(b) Random access
(c) Ascending access
(d) All the above
(b) Random access

Question 22.
The Random access memory (RAM) is also called:
(a) Primary memory
(b) Main memory
(c) Volatile memory
(d) All the above
(d) All the above

Question 23.
What is the smallest unit of information that can be stored in the memory?
(a) Bit
(b) Byte
(c) Kilo byte
(d) Mega byte
(a) Bit

Question 24.
The bytes are referred by:
(a) Be
(b) B
(c) Bi
(d) By
(b) B

Question 25.
Which of the following memory is more expensive than other memories?
(a) Static RAM (SRAM)
(b) Dynamic RAM (DRAM)
(c) PROM
(d) ROM
(a) Static RAM (SRAM)

Question 26.
Which of the memory can store critical programs such as that boots the computer?
(a) RAM
(b) ROM
(c) Memory
(d) All the above
(b) ROM

Question 27.
Which memory is programmed during the manufacturing process itself?
(a) ROM
(b) RAM
(c) PROM
(d) EPROM
(a) ROM

Question 28.
Which memory retains its contents until it is exposed to ultraviolet light?
(a) ROM
(b) RAM
(c) PROM
(d) EPROM
(d) EPROM

Question 29.
Which memory is used widely in personal computers?
(a) ROM
(b) RAM
(c) PROM
(d) EPROM
(d) EPROM

Question 30.
Which memory is used to speedup the memory retrieval process?
(a) RAM
(b) ROM
(c) Cache memory
(d) EPROM
(c) Cache memory

Question 31.
Which refers to how quickly the memory can respond to a read / write request?
(a) Response time
(b) Memory time
(d) Both (a) and (b)
(a) Response time

Question 32.
Secondary storage is also called as:
(a) Main storage
(b) Backup storage
(c) Temporary storage
(d) None of these
(b) Backup storage

Question 33.
The CD data is represented as tiny indentations is:
(a) pits
(b) track
(c) layer
(d) disk
(a) pits

Question 34.
The areas between pits are:
(a) lands
(b) tracks
(c) layers
(d) disks
(a) lands

Question 35.
DVD stands for:
(a) Digital Versatile Disc
(b) Digital Video Disc
(c) Digital Volatile Disc
(d) Either (a) or (b)
(d) Either (a) or (b)

Question 36.
CDs and DVDs are read with:
(a) layer
(b) laser
(c) pins
(d) rays
(b) laser

Question 37.
What is the colour of double-layered CD sides?
(a) Silver
(b) Yellow
(c) White
(d) Gold
(d) Gold

Question 38.
What is the colour of single-coloured CD sides?
(a) Silver
(b) Yellow
(c) White
(d) Gold
(a) Silver

Question 39.
Which memory is an electronic non-volatile computer storage medium?
(a) RAM
(b) ROM
(c) Flash
(d) Blu-ray disc
(c) Flash

Question 40.
Which of the following is known as flash memory?
(a) ROM
(b) Pen drives
(c) Memory cards
(d) Both (b) and (c)
(d) Both (b) and (c)

Question 41.
Which is a high-density optical disc similar to DVD?
(a) HD
(b) RAM
(c) ROM
(d) Blu-ray
(d) Blu-ray

Question 42.
How much gigabytes (GB) of data can be stored in double-layer Blu-ray disc?
(a) 20
(b) 30
(c) 40
(d) 50
(d) 50

Question 43.
Which type of laser is used to read and write the data in blu-ray disc?
(a) Violet
(b) Blue-violet
(c) Red-violet
(d) Silver-violet
(b) Blue-violet

Question 44.
Which type of laser is used to read and write the data in DVD?
(a) Red
(b) Blue
(c) Blue-violet
(d) Red-violet
(a) Red

Question 45.
USB stands for:
(a) Universal Serial Bus
(b) United Serial Bus
(c) Union Serial Bus
(d) Uniform Serial Bus
(a) Universal Serial Bus

Question 46.
Which port is used to connect external devices?
(a) USB
(b) VGA
(c) PS/2
(d) SCSI
(a) USB

Question 47.
Which port is used to connect input devices?
(a) USB
(b) VGA
(c) PS/2
(d) SCSI
(c) PS/2

Question 48.
Which port is used to connect sound devices and head phones?
(a) Audio plugs
(b) USB
(c) VGA
(d) PS/2
(a) Audio plugs

Question 49.
Which port is used to connect hard disk and network connectors?
(a) USB
(b) VGA
(c) PS/2
(d) SCSI
(d) SCSI

Question 50.
HDMI stands for:
(a) High Definition Multimedia Interface
(b) High Deallocation Multimedia Interface
(c) High Deblocking Multimedia Interface
(d) High Debugging Multimedia Interface
(a) High Definition Multimedia Interface

Question 51.
HDMI is a/an:
(a) locator
(b) encoder
(c) audio / video interface
(d) multiplexer
(c) audio / video interface

Question 52.
Match the following:

 (a) The speed which micro processor executes instructions (i) Word size (b) Determined by the processor (ii) Write operation (c) Address of the next instruction to be executed (iii) Clock speed (d) Transfers data from memory data register to word. (iv) Program counter

(a) (ii), (iii), (i), (iv)
(b) (iii), (i), (iv), (ii)
(c) (iv), (ii), (iii), (i)
(d) (iii), (iv), (ii), (i)
(b) (iii), (i), (iv), (ii)

Question 53.
________ deals with the engineering considerations involved in designing a computer.
(a) Computer organisation
(b) Computer architecture
(c) Microprocessor
(d) Registers
(b) Computer architecture

Question 54.
Microprocessor is made up of ______ units.
(a) 3
(b) 2
(c) 4
(d) 5
(a) 3

Question 55.
The speed at which the microprocessor executes instructions is called:
(a) clock speed
(b) instruction set
(c) word size
(d) control flow
(a) clock speed

Question 56.
The number of bits that can be processed by a processor in a single instruction is called its:
(a) clock speed
(b) instruction set
(c) word size
(d) control flow
(c) word size

Question 57.
_________ is unidirectional.
(a) Data bus
(b) Control bus
(c) Register

Question 58.
________ is bidirectional.
(a) Data bus
(b) Control bus
(c) Register
(a) Data bus

Question 59.
_________ is a volatile memory.
(a) ROM
(b) EPROM
(c) PROM
(d) RAM
(d) RAM

Question 60.
The areas between pits are known as:
(a) sector
(b) track
(c) layer
(d) lands
(d) lands

Question 61.
The capacity of an ordinary CD-ROM is:
(a) 800 MB
(b) 700 MB
(c) 900 MB
(d) 600 MB
(b) 700 MB

Question 62
________ is the type of disc used for play station games and for playing high-definition (HD) movies.
(a) Hard disks
(b) CD
(c) DVD
(d) Blu-ray disc
(d) Blu-ray disc

Question 63.
Match the following:

 (i) ALU (a) Perform an operation on data (ii) Clock speed (b) The number of bits that can be processed. (iii) Instruction set (c) Perform Arithmetic and Logical instructions (iv) Word size (d) Regulates the speed at which the microprocessor executes instruction

(a) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)
(b) (i) – (c); (ii) – (b); (iii) – (a); (iv) – (d)
(c) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)
(d) (i) – (d); (ii) – (c); (iii) – (a); (iv) – (b)
(a) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)

Question 64.
Find the odd man out:
(a) Serial
(b) USB
(c) Keyboard
(d) SCSI
(c) Keyboard

Question 65.
Find the odd man out:
(a) Intel 386
(b) Pentium II
(c) Motorola 68000
(d) AMD K6
(d) AMD K6

Question 66.
Match the following:

 (i) Parallel port (a) To connect sound speakers, microphones (ii) Audio plugs (b) To connect the printers (iii) Ps/2 port (c) To connect the hard disk drives and network connectors (iv) SCSI port (d) To connect mouse and keyboard to PC

(a) (i) – (a); (ii) – (c); (iii) – (d); (iv) – (b)
(b) (i) – (b); (ii) – (a): (iii) – (c); (iv) – (d)
(c) (i) – (a); (ii) – (d); (iii) – (c); (iv) – (b)
(d) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)
(d) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)

Question 67.
Match the incorrect pair:

 Column I Column II (a) CPU Central Processing Unit (b)MDR Memory Digital Register (c) MAR Memory Address Register (d) ALU Arithmetic and Logic Unit

(b)

Question 68.
Assertion (A):
Computer organization deals with the hardware components of a computer system.
Reason (R):
It includes Input/Output devices, the central processing unit, storage devices and primary memory.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true, and R is the correct explanation for A.

Question 69.
Assertion (A):
RISC have big set of highly optimized instructions.
Reason (R):
It reduces the size of the instruction set.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(d) A is false, but R is true.

Question 70.
Which Of the following is said to be the brain of a computer?
(a) Input devices
(b) Output devices
(c) Memory device
(d) Microprocessor
(d) Microprocessor

Question 71.
Which of the following is not the part of a microprocessor unit?
(a) ALU
(b) Control unit
(c) Cache memory
(d) Register
(c) Cache memory

Question 72.
How many bits constitute a word?
(a) 8
(b) 16
(c) 32
(d) Determined by the processor used.
(d) Determined by the processor used.

Question 73.
Which of the following device identifies the location when address is placed in the memory address register?
(a) Locator
(b) Encoder
(c) Decoder
(d) Multiplexer
(c) Decoder

Question 74.
Which of the following is a CISC processor?
(a) Intel P6
(b) AMD K6
(c) Pentium III
(d) Pentium IV
(c) Pentium III

Question 75.
Which is the fastest memory?
(a) Hard disk
(b) Main memory
(c) Cache memory
(d) Blue-Ray disc
(c) Cache memory

Question 76.
How many memory locations are identified by a processor with 8 bits address bus at a time?
(a) 28
(b) 1024
(c) 256
(d) 8000
(c) 256

Question 77.
What is the capacity of 12cm diameter DVD with single sided and single layer?
(a) 4.7 GB
(b) 5.5 GB
(c) 7.8GB
(d) 2.2 GB
(a) 4.7 GB

Question 78.
What is the smallest size of data represented in a CD?
(a) Blocks
(b) Sectors
(c) Pits
(d) Tracks
(c) Pits

Question 79.
Display devices are connected to the computer through:
(a) USB port
(b) PS/2 port
(c) SCSI port
(d) VGA connector
(d) VGA connector

## TN State Board 11th Computer Science Important Questions Chapter 2 Boolean Algebra Part 2

Question 1.
Define Truth Table.
A truth table represents all the possible values of logical variable or statements along with all the possible results of given combination of truth values.

Question 2.
What are logical operators?
The basic logical operations are AND, OR and NOT, which are symbolically represented by dot (.), plus (+), and by over bar / single apostrophe respectively. These symbols are also called as “Logical Operators”.

Question 3.
Define AND operator?
The AND operator is defined in Boolean algebra by the use of the dot (.) operator. It is similar to multiplication in ordinary algebra. The AND operator combines two or more input variables. So that the output is true only if all the inputs are true. The truth table for a 2-input AND operator is

The above 2-input AND operation is expressed as: Y = A . B

Question 4.
What is OR operator?
The plus sign is used to indicate the OR operator. The OR operator combines two or more input variables. So that the output is true if at least one input is true. The truth table for a 2-input OR operator is

The above 2-input OR operation is expressed as: Y = A + B

Question 5.
What is NOT operator?
The NOT operator has one input and one output. The input is either true or false, and the output is always the opposite, i.e., the NOT operator inverts the input. The truth table for a NOT operator where A is the input variable and Y is the output shown below:

The NOT operator is represented algebraically by the Boolean expression: Y = $$\overline{\mathrm{A}}$$.

Question 6.
What is NAND operator?
The NAND is the combination of NOT and AND. The NAND is generated by inverting the output of an AND operator. The algebraic expression of the NAND function is:
Y = $$\overline{\mathrm{A} \cdot \mathrm{B}}$$
The NAND function truth table is shown below:

A NAND B = NOT (A AND B)

Question 7.
What is called basic logic gates?
A gate is a basic electronic circuit which operates on one or more signals to produce an output signal. There are three fundamental gates namely AND, OR and NOT.

Question 8.
Write the Distributive law.
A . (B + C) = A . B + A . C
A + (B . C) = (A + B) . (A + C)

Question 9.
Complete the following:
(i) A + $$\overline{\mathrm{A}}$$ =
(ii) A. $$\overline{\mathrm{A}}$$ =
(iii) $$\overline{\overline{\mathrm{A}}}$$ =
(iv) A + A =
(v) A. A =
(vi) A + 1 =
(i) A+ $$\overline{\mathrm{A}}$$ = 1
(ii) A. $$\overline{\mathrm{A}}$$ = 0
(iii) $$\overline{\overline{\mathrm{A}}}$$ = A
(iv) A + A = A
(v) A . A = A
(vi) A + 1 = 1

Question 10.
Draw the logic circuit of Bubbled AND Gate and explain.
The Logic Circuit of Bubbled AND Gate

In the above circuit, invertors on the input lines of the above circuit, invertors on the input lines of the AND gate gives the output as C = ($$\overline{\mathrm{A}}$$ . $$\overline{\mathrm{B}}$$)This circuit can be redrawn as the bubbles on the inputs, where the bubbles represent inversion.

It is referred as bubbled AND gate.

If A = 0 and B = 0 C = ($$\overline{0} . \overline{0}$$) = 1 . 1 = 1
If A = 0 and B = 1 C = ($$\overline{0} . \overline{1}$$) = 1 . 0 = 0
If A = 1 and B = 0 C = ($$\overline{1} . \overline{0}$$) = 0 . 1 = 0
If A = 1 and B = 1 C = ($$\overline{1} . \overline{1}$$) = 0 . 0 = 0

Here the truth table is

A bubbled AND gate produces the same output as a NOR gate. So, replace each NOR gate by a bubbled AND gate. The circuits are interchangeable.

Therefore,
$$(\overline{\mathrm{A}+\mathrm{B}})=\overline{\mathrm{A}} \cdot \overline{\mathrm{B}}$$
Which establishes the De Morgan’s second theorem.

Question 11.
Draw the logic circuit of Bubbled OR Gate and explain.
The logic circuit of bubbled OR gate is

The output of this circuit can be written as
C = $$\overline{\mathrm{A}}$$ + $$\overline{\mathrm{B}}$$
The above circuit can be redrawn as the bubbles on the input, where the bubbles represents the inversion.

It is referred as bubbled OR gate. The truth table for the bubbled OR is

Comparing the truth tables of the bubbled OR gate with NAND gate, they are identical. So the circuits are interchangeable.

Therefore,

$$(\overline{\mathrm{A} \cdot \mathrm{B}})=\overline{\mathrm{A}}+\overline{\mathrm{B}}$$

which establishes the De Morgan’s second theorem.

Question 12.
Draw the symbol of logic agtes and their corresponding Truth tables.

Question 13.
Explain XOR gate with truth table.
The XOR (exclusive – OR) gate acts in the same way as the logical “either/or.” The output is “true” if either, but not both, of the inputs are “true”. The output is “false” if both inputs are “false” or if both inputs are “true”. The output is 1 if the inputs are different, but 0 if the inputs are the same. The logic circuit of XOR gate is

The output of the XOR gate is
The truth table for XOR gate is

In boolean algebra, exclusive – OR operator © or “encircled plus”.
Hence, C = A © B
The logical symbol of XOR gate is

Question 14.
What is Boolean Algebra?
It is a mathematical discipline that is used for designing digital circuits in a digital computer. It describes the relation between inputs and outputs of a digital circuit.

Question 15.
Write a short note on NAND Gate.
The NAND gate operates an AND gate followed by a NOT gate. It acts in the manner of the logical operation “AND” followed by inversion. The output is “false” if both inputs are “true”, otherwise, the output is “true”. The output of the NAND gate is 0 if and only if both the inputs are 1, otherwise the output is 1.

Question 16.
Draw the truth table for XOR gate.
The truth table for XOR gate is

Question 17.
Write the associative laws?
A + (B + C) = (A + B) + C
A. (B . C) = (A . B) . C

Question 18.
What are derived gates?
Logic gates like NAND, NOR, XOR and XNOR are derived gates which are derived from the fundamental gates.

Question 19.
Write the truth table of fundamental gates.

Question 20.
Write a short note on XNOR gate.
The XNOR (exclusive – NOR) gate is a combination XOR gate followed by an inverter. Its output is “true” if the inputs are the same, and “false” if the inputs are different. In simple words, the output is 1 if the input are the same, otherwise the output is 0. The logic circuit of XNOR gate is

The output of the XNOR is NOT of XOR
C = A ⨁ B
= $$\overline{\mathrm{A}}$$ . B + A . $$\overline{\mathrm{B}}$$
= A B + $$\overline{\mathrm{A}}$$ $$\overline{\mathrm{B}}$$
(Using De Morgan’s Theorem)
In boolean algebra, ⊙ or “included dot” stands for the XNOR.
Therefore, C = A ⊙ B
The logical symbol is

Truth Table for XOR Gate

Question 21.
Reason out why the NAND and NOR are called universal gates?
NAND and NOR gates are called Universal gates, because the fundamental logic gates can be realized through them.

Question 22.
Give the truth table of XOR gate.

Question 23.
Write the De Morgan’s law.
De Morgan’s law $$\overline{\mathrm{A}+\mathrm{B}}$$ = A . $$\overline{\mathrm{B}}$$
($$\overline{\mathrm{A} \cdot \mathrm{B}}$$) = $$\overline{\mathrm{A}}$$ + $$\overline{\mathrm{B}}$$

Question 24.
Explain the fundamental gates with expression and truth table.
The three fundamental gates namely AND, OR and NOT.
AND Gate:
The AND gate can have two or more input signals and produce an output signal. The output is “true” only when both inputs are “true”, otherwise, the output is “false”. The output will be 1 if and only if both inputs are 1; otherwise the output is 0. The output of the AND gate is represented by a variable say C, where A and B are two and if input boolean variables. In boolean algebra, a variable can take either of the values ‘0’ or ‘1’.

One way to symbolize the action of an AND gate is by writing the boolean function.
C = A AND B
In boolean algebra the multiplication sign stands for the AND operation. Therefore, the output of the AND gate is
C = A . B or simply C = AB
Read this as “C equals A AND B”. Since there are two input variables here, the truth table has four entries, because there are four possible inputs : 00, 01, 10 and 11.
For instance if both inputs are 0,
C = A .B = 0 . 0 = 0
The truth table for AND Gate is

OR Gate:
The OR gate behaves like the logical inclusive “OR”. The output is “true” if either or both of the inputs are “true”. If both inputs are “false” then the output is “false”. The output will be 1 if and only if one or both inputs are 1; otherwise, the output is 0. The logical symbol of the OR gate is

The OR gate output is
C = A OR B
We use the + sign to denote the OR function. Therefore,
C = A + B
Read this as “C equals A OR B”.
For instance, if both the inputs are 1
C = A + B = 1 + 1 = 1
The truth table for OR gate is

NOT Gate:
The NOT gate, called a logical inverter, has only one input. It reverses the logical state. The output C is always the complement of the input. The logical symbol of the NOT gate is

C = NOT A
In boolean algebra, the overbar stands for NOT operation. Therefore,
C = $$\overline{\mathrm{A}}$$
Read this as “C equals NOT A” or “C equals the complement of A”.
If A is 0,
C = $$\overline{1}$$ = 0
On the otherhand, if A is 1,
C = $$\overline{1}$$ = 0
The truth table for NOT gate is

Question 25.
How AND and OR can be realized using NAND and NOR gate.
The output of NOR gate is
C = $$\overline{\mathrm{A}+\mathrm{B}}$$

The output of Bubbled AND gate is
C = $$\overline{\mathrm{A}}$$ . $$\overline{\mathrm{B}}$$

The truth table for both Bubbled AND and NOR gate is

From the above table, a bubbled AND gate produces the same output as a NOR gate. In this way we can realised AND gate using NOR gate.
The output of NAND gate is C = $$\overline{\mathrm{A} \cdot \mathrm{B}}$$
The output of Bubbled OR gate is C = $$\overline{\mathrm{A}}$$ + $$\overline{\mathrm{B}}$$

The truth table for both bubbled OR gate and NAND gate is

From the above table, a bubbled OR gate produces the same output as a NAND gate. In this way we can realised OR gate using NAND gate.

Question 26.
Explain the Derived gates with expression and truth table.
The NAND gate operates an AND gate followed by a NOT gate. It acts in the manner of the logical operation “AND” followed by inversion. The output is “false” if both inputs are “true”, otherwise, the output is “true”. The output of the NAND gate is 0 if and only if both the inputs are 1, otherwise the output is 1. The logic circuit of NAND gate is

The logical symbol of NAND gate is

The output of the NAND gate is
C = ($$\overline{\mathrm{A} \cdot \mathrm{B}}$$)

Read this as “C equals NOT of A AND B” or “C equals the complement of A and B”.

For example if both the inputs are 1

C = $$(\overline{1.1})=\overline{1}$$ = 0
The truth table for NAND gate is

Question 1.
The AND operator is defined in Boolean algebra by the use of the operator
(a) +
(b) –
(c) *
(d) .
(d) .

Question 2.
The plus sign is used to indicate the ______ operator.
(a) AND
(b) OR
(c) NOT
(d) NAND
(b) OR

Question 3.
The _______ is the combination of NOT and AND.
(a) NAND
(b) XOR
(c) XNOR
(d) NOT
(a) NAND

Question 4.
Which gate is the combination XOR gate followed by the inverter?
(a) XNOR
(b) XOR
(c) OR
(d) NOR
(a) XNOR

Question 5.
How many fundamental logic gates?
(a) 1
(b) 2
(c) 3
(d) 4
(c) 3

Question 6.
A + 0 is:
(a) 1
(b) 0
(c) A
(d) $$\overline{\mathrm{A}}$$
(c) A

Question 7.
A. $$\overline{\mathrm{A}}$$ is:
(a) A
(b) 0
(c) $$\overline{\mathrm{A}}$$
(d) 1
(b) 0

Question 8.
A + A is:
(a) 2A
(b) A2
(c) A
(d) +1
(c) A

Question 9.
A + 1 is:
(a) 1A
(b) A
(c) 1
(d) 2A
(c) 1

Question 10.
________ Gate is called logic inverter.
(a) OR
(b) NOT
(c) AND
(d) None
(b) NOT

Question 11.
Who proposed the basic principles of Algebra?
(a) George Boole
(b) George William
(c) George Kingston
(d) George Barsley
(a) George Boole

Question 12.
The variable which can stored truth values are called:
(a) Logical variable
(b) Binary valued variables
(c) Boolean variable
(d) All the above
(d) All the above

Question 13.
The basic logical operations symbol are also called:
(a) Arithmetic operators
(b) Logical operators
(c) Conditional operators
(d) Relational operators
(b) Logical operators

Question 14.
Which logical operator has one input and one output?
(a) AND
(b) OR
(c) NOT
(d) NAND
(c) NOT

Question 15.
Which operator is generated by inverting the output of an AND operator?
(a) NAND
(b) NOT
(c) OR
(d) NOR
(a) NAND

Question 16.
Which operator is the combination of NOT and OR?
(a) NAND
(b) NOT
(c) OR
(d) NOR
(d) NOR

Question 17.
Which operator is generated by inverting the output of an OR operator?
(a) NOR
(b) NAND
(c) NOT
(d) OR
(a) NOR

Question 18.
(a) NOR
(b) NOT
(c) AND
(d) OR
(c) AND

Question 19.
Which gate gets its name from its behaviour like the logical inclusive?
(a) OR
(b) AND
(c) NOT
(d) NAND
(a) OR

Question 20.
Which gate circuit is an OR gate followed by an inverter?
(a) NAND
(b) NOR
(c) NOT
(d) AND
(b) NOR

Question 21.
⊙ – (included dot) stands for the:
(a) XNOR
(b) XOR
(c) NAND
(d) NOR
(a) XNOR

Question 22.
Which of the logic gates are found in digital integrated circuits?
(a) gates
(b) arrays
(c) operation
(d) physical space
(b) arrays

Question 23.
A + $$\overline{\mathrm{A}}$$ is:
(a) 0
(b) 1
(c) A
(d) $$\overline{\mathrm{A}}$$
(b) 1

Question 24.
A.A is:
(a) 0
(b) 1
(c) A
(d) $$\overline{\mathrm{A}}$$
(c) A

Question 25.
A.0 is:
(a) 0
(b) 1
(c) A
(d) $$\overline{\mathrm{A}}$$
(a) 0

Question 26.
$$(\overline{\overline{\mathrm{A}})}$$ is:
(a) 0
(b) 1
(c) A
(d) $$\overline{\mathrm{A}}$$
(c) A

Question 27.
The symbol of NOT gate is:
(a)

(b)

(c)

(d)

(a)

Question 28.
Choose the odd man out:
(a) F
(b) E
(c) D
(d) H
(d) H

Question 29.
Choose the odd man out:
(a) AND
(b) OR
(c) NOR
(d) NOT
(c) NOR

Question 30.
Match the following:

 (i) AND Operator (a) Y = A + B (ii) OR Operator (b) Y= $$\overline{\mathrm{A}}$$ (iii) NOT Operator (c) Y = $$\overline{\mathrm{A} \cdot \mathrm{B}}$$ (iv) NAND Operator (d) Y = A . B

(a) (i) – (a); (ii) – (b); (iii) – (c); (iv) – (d)
(b) (i) – (b); (ii) – (a); (iii) – (c); (iv) – (d)
(c) (i) – (c); (ii) – (b); (iii) – (d); (iv) – (a)
(d) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(d) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)

Question 31.
Match the following:

 (i) A + 0 (a) A + B (ii) A . $$\overline{\mathrm{A}}$$ (b) 1 (iii) A + 1 (c) 0 (iv) A . $$\overline{\mathrm{A}}$$ . B (d) A

(a) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)
(b) (i) – (c); (ii) – (b); (iii) – (a); (iv) – (d)
(c) (i) – (d); (ii) – (b); (iii) – (a); (iv) – (c)
(d) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(a) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)

Question 32.
Choose the incorrect pair:

 Column I Column II (a) A + B B + A (b) A + (A . B) A (c) A + $$\overline{\mathrm{A}}$$ . B A . B (d) $$\overline{\mathrm{A}+\mathrm{B}}$$ $$\overline{\mathrm{A}}$$ . $$\overline{\mathrm{B}}$$

(c)

Question 33.
Assertion (A):
The NAND gate operates on OR gate followed by a NOT gate.
Reason (R):
It acts in the manner of the logical operation ‘AND’ followed by inversion.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(d) A is false, but R is true.

Question 34.
Assertion (A):
The XOR(exclusive-OR) gate acts in the same way as the logical ‘either/or’.
Reason (R):
The output is ‘true’ if either, but not both of the inputs are ‘true’.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true, and R is the correct explanation for A.

Question 35.
Which is a basic electronic circuit which operates on one or more signals?
(a) Boolean algebra
(b) Gate
(c) Fundamental gates
(d) Derived gates
(b) Gate

Question 36.
Which gate is called as the logical inverter?
(a) AND
(b) OR
(c) NOT
(d) XNOR
(c) NOT

Question 37.
A + A = ?
(a) A
(b) O
(c) 1
(d) A
(a) A

Question 38.
NOR is a combination of ?
(a) NOT(OR)
(b) NOT(AND)
(c) NOT(NOT)
(d) NOT(NOR)
(a) NOT(OR)

Question 39.
NAND is called as ________ Gate.
(a) Fundamental Gate
(b) Derived Gate
(c) Logical Gate
(d) Electronic Gate
(b) Derived Gate

## TN State Board 11th Computer Science Important Questions Chapter 2 Number Systems Part 1

Question 1.
Define word length.
Word length refers to the number of bits processed by a Computer’s CPU. A word length can have 8 bits, 16 bits, 32 bits and 64 bits (Present Computers use 32 bits or 64 bits).

Question 2.
Define byte.
A collection of 8 bits is called Byte. A byte is considered as the basic unit of measuring the memory size in the computer.

Question 3.
What is a bit?
A bit is the short form of Binary digit which can be ‘0’ or ‘ 1 ’. It is the basic unit of data in computers.

Question 4.
What is Decimal Number System?
It consists of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (10 digits). It is the oldest and most popular number system used in our day-to-day life. In the positional number system, each decimal digit is weighted relative to its position in the number. It means that each digit in the number is multiplied by 10 raised to a power corresponding to that digit’s position.

Question 5.
What is meant by Octal Number System?
Octal number system uses digits 0, 1, 2, 3, 4, 5, 6 and 7 (8 digits). Each octal digit has its own positional value or weight as a power of 8.

Question 6.
Convert (547)<sub>8</sub> to its decimal equivalent?
The Octal sequence (547)<sub>8</sub> has the decimal equivalent:
(547)8 = 5 × 82 + 4 × 81 + 7 × 80
= 5 × 64 + 4 × 8 + 7 × 1
= 320 + 32 + 7 = (359)10

Question 7.
(11.011)2 convert into decimal number.

= 3 + (0 × 0.5 + 1 × 0.25 + 1 × 0.125)
= 3 + 0 + 0.25 + 0.125 = (3.375)10

Question 8.
(6213)8 convert into binary number.

Question 9.
What is a character set?
In general, 26 uppercase letters, 26 lowercase letters, 0 to 9 digits and special characters are used in a computer is called character set. All these character set are denoted through numbers only.

Question 10.
Convert (65)10 into its equivalent binary number.

Question 11.
How will you convert decimal to octal? Give example.
To convert Decimal to Octal, “Repeated Division by 8” method can be used. Here, we have to divide the given number by 8.
Eg: Convert (65)10 into its equivalent Octal Number.

Question 12.
Write octal numbers and their binary equivalent.

 Octal Binary Equivalent 0 000 1 001 2 010 3 011 4 100 5 101 6 110 7 111

Question 13.
In what ways the numbers are represented in computers?
The numbers are represented in computers in different ways:
(i) Signed Magnitude representation.
(ii) 1 ’s Complement.
(iii) 2’s Complement.

Question 14.
Convert (11010110)2 into octal equivalent.

Question 15.
Convert the following binary numbers to decimal
(i) 11101,
(ii) 1011010.
(i) 11101

(ii) 1011010

Question 16.
Convert (3EF)16 to decimal.

Question 17.
Convert (111011)2 into its equivalent decimal number.

Question 18.
Write short note on hexadecimal number system.
A hexadecimal number is represented using base 16. Hexadecimal or Hex numbers are used as a shorthand form of binary sequence. This system is used to represent data in a more compact manner. Since 16 symbols are used, 0 to F, the notation is called hexadecimal. The first 10 symbols are the same as in the decimal system, 0 to 9 and the remaining 6 symbols are taken from the first 6 letters of the alphabet sequence, A to F, where A represents 10, B is 11, C is 12, D is 13, E is 14 and F is 15.
Eg: The hexadecimal sequence (25)16 has the decimal equivalent:
(25)<sub>16</sub> = 2 × 16<sup>1</sup> + 5 × 16<sup>0</sup>
= 32 + 5 = (37)<sub>10</sub>

Question 19.
Write the hierarchy of data representation.

Question 20.
Write the steps for binary to decimal conversion.
To convert Binary to Decimal we can use
positional notation method.
Step 1: Write down the Binary digits and list the powers of 2 from right to left (Positional Notation)
Step 2: For each positional notation written for the digit, now write the equivalent weight.
Step 3: Multiply each digit with its corresponding weight.
Step 4: Add all the values.

Question 21.
How will you convert binary to octal?
Step 1: Group the given binary number into 3 bits from right to left.
Step 2: You can add preceding 0 to make a group of 3 bits if the left most group has less than 3 bits.
Step 3: Convert equivalent octal value using “2’s power positional weight method”.
Eg: Convert (11010110)2 to its Octal equivalent.

Question 22.
Write the steps for converting binary to hexadecimal.
Step 1: Group the given number into 4 bits from right to left.
Step 2: You can add preceding 0’s to make a group of 4 bits if the left most group has less than 4 bits.
Step 3: Convert equivalent Hexadecimal value using “2’s power positional weight method”.
Eg: Convert (111 1010110)2 to Hexadecimal.

[Note: 0’s are added to the left most group to make it a group of 4 bits]

Question 23.
Write the steps for octal to decimal conversion.
To convert octal to decimal, we can use positional notation method.
(i) Write down the octal digits and list the powers of 8 from right to left(Positional Notation).
(ii) For each positional notation of the digit write the equivalent weight.
(iii) Multiply each digit with its corresponding weight.
Eg: Convert (1265)8 to equivalent Decimal number.

(1265)8 = 512 × 1 + 64 × 2 + 8 × 6 + 1 × 5
= 512 + 128+ 18 + 5
(1265)8 = (693)10

Question 24.
Write the steps for converting hexadecimal to decimal.
To convert Hexadecimal to Decimal we canuse positional notation method.
(i) Write down the Hexadecimal digits and list the powers of 16 from right to left (Positional Notation).
(ii) For each positional notation written for the. digit, now write the equivalent weight.
(iii) Multiply each digit with its corresponding weight.
(iv) Add all the values to get one final value.
Eg: Convert (25F)16 into its equivalent Decimal number.

(25F)16 = 2 × 256 + 5 × 16 + 15 × 1
= 512 + 80 + 15
(25F)16 = (607)10

Question 25.
Write short note on signed magnitude representation.
The value of the whole numbers can be determined by the sign used before it. If the number has ‘+‘ sign or no sign it will be considered as positive. If the number has ‘—‘ sign it will be considered as negative.
Eg: +43 or 43 is a positive number.
– 43 is a negative number.

In signed binary representation, the left most bit is considered as sign bit. If this bit is O, it is a positive number and if it is 1, it is a negative number. Therefore a signed binary number has 8 bits, only 7 bits used for storing values (magnitude) and the 1 bit is used for sign.
+ 43 is represented in memory as follows:

– 43 is represented in memory as follows:

Question 26.
Write 2’s complement procedure with example.
The 2’s complement method for negative number is as follows:
(i) Invert all the bits in the binary sequence
(i.e., change every 0 to 1 and every 1 to 0 i.e.,1‘s complement).
(ii) Add I to the result to the Least Significant Bit (LSB).
Eg: 2’s Complement represent of (-24)10
Binary equivalent of +24 = 11000
8bit format = 00011000
1’s complement = 11100111
Add 1 to LSB = +1
2’s complement of -24 = 11101000

Question 27.
Write short note unicode.
Unicode is used in most of the modem computers. The popular coding scheme after ASCII is Unicode. ASCII can represent only 256 characters. ‘English and European Languages alone can be handled by ASCII.
Languages like Tamil, Malayalam, Kannada and Telugu could not be represented by ASCII. Hence, the Unicode was generated to handle all the coding system of Universal languages. Unicode is 16 bit code and can handle 65536 characters.

Question 28.
Give the steps to convert fractional binary to decimal equivalent with example.
Step 1:
Convert integral part of Binary to Decimal equivalent using positional notation method.

Step 2:
To convert, the fractional part of binary to its decimal equivalent.

Step 2.1:
Write down the Binary digits in the fractional part.

Step 2.2:
For all the digits write powers of 2 from left to right starting from 2-1, 2-2, 2-3, ………….2-n, now write the equivalent weight.

Step 2.3:
Multiply each digit with its corresponding weight.

Step 2.4:
Add all the values which you obtained in Step 2.3.

Step 3:
To get final answer write the integral part (after conversion), followed by a decimal point(.) and the answer arrived at

Step 2.4.
Eg: Convert the given Binaxy number(11.011)2 into its decimal equivalent Integer part
(11)2 = 3.

3 + (0 × 0.5 + 1 × 0.25 + 1 × 0.125) = 3.375
3 + 0.75 = 3.75
(11.011)2 = (3.375)10

Question 29.
Explain in detail the different encoding systems used for computer.
There are several encoding systems used for computer. They are –
(i)Binary Coded Decimal (BCD):
It is 26 bit encoding system. It can handle 26 = 64 characters only. This encoding system is not in the practice right now.

(ii)American Standard Code for information Interchange (ASCII):
This is the most popular encoding system recognized by United States. Most of the computers use this system. This encoding system can handle English characters only. This can handle 2<sup>7</sup> bit which means 128 characters. Here each character has individual number.

The new edition (version) ASCII – 8, has 2<sup>8</sup> bits and can handle 256 characters represented from 0 to 255 unique umbers.

The ASCII code equivalent to the uppercase letter ‘A’ is 65. The binary representation of ASCII (7 bit) value is 1000001. Also 01000001 in ASCII-8 bit.

(iii)Extended Binary Coded Decimal Interchange Code (EBCDIC):
This is similar to ASCII Code with 8 bit representation. This coding system is formulated by International Business Machine(IBM). The coding system can handle 256 characters. The input code in ASCII can be converted to EBCDIC system and vice – versa.

(iv)Indian Standard Code for Information Interchange (ISCII):
ISCII is the system of handling the character of Indian local languages. This is a 8-bit coding system and can handle 256 (2<sup>8</sup>) characters. It is formulated by the department of Electronics in India in the year 1986- 88 and recognized by Bureau of Indian Standards (BIS). Now this coding system is integrated with Unicode.

(v) Unicode:
This coding system is used in most of the modem computers. The popular coding scheme after ASCII is Unicode. ASCII can represent only 256 characters. Therefore English and European Languages alone can be
handled by ASCII. Languages like Tamil, Malayalam, Kannada and Telugu could not be represented by ASCII. Hence, the Unicode was generated to handle all the coding system of Universal languages. This is 16 bit code and can handle 65536 characters.

Question 30.
Identify the number system for the following numbers.

Question 31.
State whether the following numbers are valid or not. If invalid, give reason.

Question 32.
Convert the following Decimal numbers to its equivalent Binary, Octal, Hexadecimal.
(i) 1920,
(ii) 255,
(iii) 126.
(i) 1920

(ii) 255

(iii) 126

Question 33.
Convert the given Binary number into its equivalent Decimal, Octal and Hexadecimal number.
(i) 101110101, (ii) 1011010, (iii) 101011111.

(i) 101110101 into Decimal number

(ii) 1011010 to Decimal

(iii) 101011111 to Decimal

Question 34.
Convert the foltowing Octal numbers into Binary numbers.
(a) 472, (b) 145, (c) 347, (d) 6247, (e) 645.

(a) 472

(b) 145

(c) 347

(d) 6247

(e) 645

Question 35.
Convert the following Hexadecimal numbers to Binary numbers:
(a) A6, (b) BE, (c) 9BC8, (d) BC9.

(a) A6

(b) BE

(c) 9BC8

(d) BC9
B → 11 C → 12

Question 36.
Write the l’s complement number and 2’s complement number for the following decimal numbers:
(a) 22 (b) -13 (c) -65 (d) -46

(a) – 22 → 101102

(b) -13 → 1101

(c) -65 → 1000001

(d) -46 → 1011102

Question 37.
Perform the following binary computations:
(a) 1010 + 1510
(b) – 1210 + 510
(c) 1410 – 1210
(d) (-2)10 – (- 610).

(a) 1010 + 1510

(b) – 1210 + 510

(c) 1410 – 1210
14 = 1110 = 00001110
– 12 = 1100 = 00001100

[The final carry bit is lost because it cannot be accommodated in the 8 – bit register]

(d) (-2)10 – (- 610)
-2 = 10
8 bit from = 00000010
1’s complement = 11111101

Question 38.
What is data?
The term data comes from the word datum, which means a raw fact. The data is a fact about people, places or some objects.
Eg: Let ‘Name’, ‘Age’, ‘Class’, ‘Marks’ and ‘Subject’ be some defined variables. Assign a value to each of these variables.
Name = Rajesh
Age = 16
Class = XI
Mark = 65
Subject = Computer Science
Here, the values assigned to the five different variables are called data.

Question 39.
Write the l’s complement procedure.
Step 1: Convert the given Decimal number into Binary
Step 2: Check if the binary number contains 8 bits , if less add 0 at the left most bit, to make it as 8 bits.
Step 3: Invert all bits (i.e.,s Change 1 as 0 and 0 as 1)

Question 40.
Convert (46)10 into Binary number.

Question 41.
We cannot find l’s complement for (28)10. State reason.
1 ’s complement representation is an easier approach to represent signed numbers. This is for negative numbers only. This (28)10 this whole numbers cannot be determined by negative number because the number whose MSB is 1.

Question 42.
List the encoding systems for characters in memory.
There are several encoding systems used for computer. They are
(i) BCD: Binary Coded Decimal.
(ii) EBCDIC: Extended Binary Coded Decimal Interchange Code.
(iii) ASCII: American Standard Code for Information Interchange.
(iv) Unicode
(v) ISCII: Indian Standard Code for Information Interchange.

Question 43.
What is radix of a number system? Give example.
A numbering system is a way of representing numbers. The most commonly used numbering system in real life is Decimal number system. Other number systems are Binary, Octal, Hexadecimal number system. Each number system is uniquely identified by its base value or radix. Radix or base is the count of number of digits in each number system. Radix or base is the general idea behind positional numbering system.
Eg:(123)10, (547)8, (1001)2, (25)16.
In this, 10, 8, 2, 16 are radix or base value.

Question 44.
Write note on binary number system.
There are only two digits in the Binary system, 0 and 1. The numbers in the binary system are represented to the base 2 and the positional multipliers are the powers of 2. The left most bit in the binary number is called as the Most Significant Bit (MSB) and it has the largest positional weight. The right most bit is the Least Significant Bit (LSB) and has the smallest positional weight.

Eg: The binary sequence (1101)2 has the decimal equivalent:
(1101)2 = 1 × 23 + 1 × 22 + 0 × 21 + 1 × 20
= 8 + 4 + 0 + 1 =(13)10

Question 45.
Convert (150)10 into Binary, then convert that Binary number to Octal.

Question 46.
Write short note on ISCII.
ISCII is the system of handling the character of Indian local languages. This is a 8-bit coding system. So it can handle 256 (28) characters. This system is formulated by the department of Electronics in India in the year 1986-88 and recognized by Bureau of Indian Standards (BIS). Now this coding system is integrated with Unicode.

Question 47.
(ii) 2010 + 2510.

(i) -2210 + 1510

(ii) 20 + 25

Question 48.
(a) Write the procedure to convert fractional Decimal to Binary.
(b) Convert (98.46)10 to Binary.
(a) The method of repeated multiplication by 2 has to be used to convert such kind of decimal fractions.
The steps involved in the method of repeated multiplication by 2:

Step 1: Multiply the decimal fraction by 2 and note the integer part. The integer part is either 0 or 1.
Step 2: Discard the integer part of the previous product. Multiply the fractional part of the previous product by 2. Repeat Step 1 until the same fraction repeats or terminates (0).
Step 3: The resulting integer part forms a sequence of 0s and Is that become the binary equivalent of decimal fraction.
Step 4: The final answer is to be written from first integer part obtained till the last integer part obtained.

(b) (98.46)10

Question 49.
Find 1’s Complement and 2’s Complement for the following Decimal number: (a) – 98,
(b) -135.
(a) – 98
First, convert given decimal number into binary.

Binary number = 11000102
Second, check binary number as 8 bits, If less add 0 as the left most bit, 01100010
Third, Invert all bits (change 1 as 0 and 0 as 1) 1 ’s complement for 10011101.
2’s complement:
Binary equivalent of + 98 = 1100010
8 bit format = 01100010
1 ’s complement = 10011101
Add 1 to LSB = 1
10011110
2’s complement of – 98 = 100111102

(b) – 135
First, convert given decimal number into Binary.

Second, check binary number as 8 bits, If less add 0 at the left most bit. It has 8 bits, 10000111.
Third, Invert all bits (change 1 as 0 and 0 as 1) 1 ’s complement for 01111000.

2’s complement:
Binary equivalent of + 135 = 10000111
8 bit format = 10000111
1 ’s complement = 01111000
Add 1 to LSB = 1
01111001
2’s complement of- 135 = 011110012

Question 50.
(b) Subtract 11010112 – 1110102

(b) Subtract 11010112 – 1110102

11010112 – 1110102

11010112 – 1110102 = 1100012

Question 1.
A bit is the short form of:
(a) binary data
(b) binary digit
(c) binary decimal
(d) big digit
(b) binary digit

Question 2.
A ________ is a collection of 4 bits.
(a) bit
(b) byte
(c) nibble
(d) word length
(c) nibble

Question 3.
A collection of 8 bits is called:
(a) bit
(b) byte
(c) word length
(d) nibble
(b) byte

Question 4.
2^40 is referred as:
(a) mega
(b) giga
(c) peta
(d) tera
(d) tera

Question 5.
2^70 is referred as:
(a) peta
(b) exa
(c) zetta
(d) yotta
(c) zetta

Question 6.
1024 GB is referred as :
(a) kilo byte
(b) mega byte
(c) giga byte
(d) tera byte
(d) tera byte

Question 7.
____________ are used to represent characters in a text.
(a) Bits
(b) Bytes
(c) Nibble
(d) Wordlength
(b) Bytes

Question 8.
The ASCII value for blank space is:
(a) 32
(b) 91
(c) 48
(d) 65
(a) 32

Question 9.
The ASCII value for numeric 0 is:
(a) 32
(b) 97
(c) 48
(d) 65
(c) 48

Question 10.
Each number system is uniquely identified by its:
(a) decimal value
(b) binary value
(d) octal value

Question 11.
The range of ASCII values for lower case alphabets is from:
(a) 97 to 122
(b) 65 to 90
(c) 98 to 122
(d) 97 to 123
(a) 97 to 122

Question 12.
The range of ASCII values for upper case alphabets is from:
(a) 97 to 122
(b) 65 to 90
(c) 66 to 90
(d) 65 to 97
(b) 65 to 90

Question 13.
The expansion of MSB is:
(a) Most Significant Bit
(b) Most Signed Bit
(c) Must Significant Bit
(d) Must Signed Bit
(a) Most Significant Bit

Question 14.
The expansion of LSB is:
(a) Lower Significant Bit
(b) Least Significant Bit
(c) Lower Signed Bit
(d) Least Signed Bit
(b) Least Significant Bit

Question 15.
(a) 2
(b) 10
(c) 16
(d) 8
(d) 8

Question 16.
The binary sequence (1101)2 has the decimal equivalent:
(a) (25)10
(b) (15)10
(c) (17)10
(d) (13)10
(d) (13)10

Question 17.
(a) 11
(b) 10
(c) 12
(d) 15
(c) 12

Question 18.
The simplest method to represent negative binary numbers is called:
(a) signed magnitude
(b) unsigned magnitude
(c) magnitude bit
(d) unmagnitude bit
(a) signed magnitude

Question 19.
EBDIC coding system can handle characters.
(a) 64
(b) 255
(c) 256
(d) 128
(c) 256

Question 20.
The most commonly used coding scheme is the:
(a) Binary Coded Decimal
(b) Extended Binary Coded Decimal Interchange Code
(c) Indian Standard Code for Information Interchange
(d) American Standard Code for Information Interchange
(d) American Standard Code for Information Interchange

Question 21.
Which is the basic unit of measuring the memory size in the computer?
(a) bit
(b) byte
(c) nibble
(d) word length
(b) byte

Question 22.
What is the most commonly used numbering system in real life?
(a) Binary
(b) Octal
(c) Decimal
(c) Decimal

Question 23.
Which of the following is octal number?
(a) 1101
(b) 1178
(c) 778
(d) 8005
(a) 1101

Question 24.
Which of the following is not a binary number?
(a) 2101
(b) 1000
(c) 1111
(d) 1001
(a) 2101

Question 25.
Which of the following is a Hexadecimal number?
(a) 1234
(b) ABCD
(c) 1001
(d) All the above
(d) All the above

Question 26.
Unicode is a ______ bit code.
(a) 8
(b) 16
(c) 32
(d) 64
(b) 16

Question 27.
What is the 1 ’s complement for (-24)10?
(a) 00011000
(b) 11100111
(c) 11110011
(d) 11100001
(b) 11100111

Question 28.
Who formulated ASCII coding system?
(a) Microsoft
(b) Oracle
(c) IBM
(d) SVN
(c) IBM

Question 29.
What is the ASCII value of A in decimal number?
(a) 65
(b) 66
(c) 67
(d) 68
(a) 65

Question 30.
ISCII coding system is formulated by:
(a) Electronics in India
(b) IBM
(c) Oracle corporation
(d) Sun micro systems
(a) Electronics in India

Question 31.
Which coding system is used in most of the modern computers?
(a) ASCII
(b) BCD
(c) ISCII
(d) Unicode
(d) Unicode

Question 32.
Unicode scheme is denoted by:
(a) Binary numbers
(b) Octal numbers
(d) Decimal numbers

Question 33.
What is the ASCII value of a in decimal number?
(a) 95
(b) 96
(c) 97
(d) 98
(c) 97

Question 34.
What is the ASCII value of * symbol in Hexadecimal number?
(a) 2B
(b) 2A
(c) 2C
(d) 2D
(b) 2A

Question 35.
What is the ASCII value of @ symbol in octal number?
(a) 111
(b) 571
(c) 100
(d) 123
(c) 100

Question 36.
Unicode can handle characters.
(a) 65536
(b) 75536
(c) 66535
(d) 85536
(a) 65536

Question 37.
BCD can handle _______ characters only.
(a) 65
(b) 75
(c) 64
(d) 94
(c) 64

Question 38.
ASCII can handle characters.
(a) 365
(b) 128
(c) 256
(d) 255
(b) 128

Question 39.
________ can handle all the coding system of universal languages.
(a) Unicode
(b) ISCII
(c) EBCDIC
(d) BCD
(a) Unicode

Question 40.
Choose the odd man out:
(a) Bit
(b) Byte
(c) Nibble
(d) IBM
(d) IBM

Question 41.
Choose the odd man out:
(a) Octal variable
(b) Logical variable
(c) Binary valued variable
(d) Boolean variable
(a) Octal variable

Question 42.
Match the following:

 (i) (1010)2 (a) Octal (ii) (989)16 (b) Binary (iii) (750)8 (c) Decimal (iv) (926)10 (d) Hexadecimal

(a) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(b) (i) – (b); (ii) – (d); (iii) – (a); (iv) – (c)
(c) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)
(d) (i) – (d); (ii) – (b); (iii) – (a); (iv) – (c)
(b) (i) – (b); (ii) – (d); (iii) – (a); (iv) – (c)

Question 43.
Match the following:

 Hexadecimal Binary (i) A (a) 1101 (ii) B (b) 1010 (iii) D (c) 1110 (iv) E (d) 1011

(a) (i) – (d); (ii) – (b); (iii) – (a); (iv) – (c)
(b) (i) – (c); (ii) – (d); (iii) – (a); (iv) – (b)
(c) (i) – (b); (ii) – (d); (iii) – (a); (iv) – (c)
(d) (i) – (b); (ii) – (a); (iii) – (d); (iv) – (c)
(c) (i) – (b); (ii) – (d); (iii) – (a); (iv) – (c)

Question 44.
Match the following:

 (i) BCD (a) 0 – 15 (ii) EBCDIC (b) 65536 characters (in) Unicode (c) 256 characters (iv) Hexadecimal (d) 64 characters

(a) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)
(b) (i) – (d); (ii) – (a); (iii) – (b); (iv) – (c)
(c) (i) – (a); (ii) – (b); (iii) – (d); (iv) – (c)
(d) (i) – (c); (ii) – (a); (iii) – (d); (iv) – (b)
(a) (i) – (d); (ii) – (c); (iii) – (b); (iv) – (a)

Question 45.
Choose the correct pair.

 Column – I Column – II (a) 2 011 (b) 4 100 (c) 5 110 (d) 7 010

(b)

Question 46.
Choose the incorrect pair.

 Column – I Column – II (a) Kilo byte 2^10 (b) Mega byte 2^20 (c) Peta byte 2^50 (d) Exa 2^70

(d)

Question 47.
Assertion (A):
The computer can understand only Machine language.
Reason (R):
The Machine language is 0 and 1.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true, and R is the correct explanation for A.

Question 48.
Assertion (A):
A numbering system is a way of representing numbers.
Reason (R):
The most commonly used numbering system in real life is Binary number system.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A.
(c) A is true, but R is false.
(d) A is false, but R is true.
(c) A is true, but R is false.

Question 49.
Assertion (A):
The popular coding scheme after ASCII is Unicode.
Reason (R):
The Unicode was generated to handle all the coding system of universal language.
(a) Both A and R are true, and R is the correct explanation for A.
(b) Both A and R are true, but R is not the correct explanation for A
(c) A is true, but R is false.
(d) A is false, but R is true.
(a) Both A and R are true, and R is the correct explanation for A.

Question 50.
A collection of 8 bits is called:
(a) bit
(b) byte
(c) word length
(d) nibble
(b) byte

Question 51.
The ASCII value for numeric 0 is:
(a) 32
(b) 97
(c) 48
(d) 65
(c) 48

Question 52.
The expansion of LSB is:
(a) Lower Significant Bit
(b) Least Significant Bit
(c) Lower Significant Bit
(d) Least Signed Bit
(b) Least Significant Bit

Question 53.
Which refers to the number of bits processed by a computer’s CPU?
(a) Byte
(b) Nibble
(c) Word length
(d) Bit
(c) Word length

Question 54.
How many bytes does 1 KiloByte contain?
(a) 1000
(b) 8
(c) 4
(d) 1024
(d) 1024

Question 55.
Expansion for ASCII:
(a) American School Code for Information Interchange
(b) American Standard Code for Information Interchange
(c) All Standard Code for Information Interchange
(d) American Society Code for Information Interchange
(b) American Standard Code for Information Interchange

Question 56.
2^50 is referred as:
(a) kilo
(b) tera
(c) peta
(d) zetta
(c) peta

Question 57.
How many characters can be handled in Binary Coded Decimal System?
(a) 64
(b) 255
(c) 256
(d) 128
(a) 64

Question 58.
For 11012 what is the Hexadecimal equivalent?
(a) F
(b) E
(c) D
(d) B
(c) D

Question 59.
What is the 1 ’s complement of 00100110?
(a) 00100110
(b) 11011001
(c) 11010001
(d) 00101001