KPK Board 10th class Computer Ch 3 Input and Output Handling short questions answers

We are providing all Students from 5th class to master level all exams preparation in free of cost. Now we have another milestone achieved, providing all School level students to the point and exam oriented preparation question answers for all science and arts students.

After Online tests for all subjects now it’s time to prepare the next level for KPK board students to prepare their short question section here. We have a complete collection of all classes subject wise and chapter wise thousands questions with the right answer for easy understanding.

We provided 12th class English short questions answers on this page of all KPK boards. Students of KPK boards can prepare the English subject for annual examinations.

In this List we have included all KPK boards and both Arts and Science students. These Boards students can prepare their exam easily with these short question answer section

Malakand Board 10th classes short questions Answer

Mardan Board 10th classes short questions Answer

Peshawar Board 10th classes short questions Answer

Swat Board 10th classes short questions Answer

Dera Ismail Khan Board 10th classes short questions Answer

Kohat Board 10th classes short questions Answer

Abbottabad  Board 10th classes short questions Answer

Bannu Board 10th classes short questions Answer

All above mention KPK Boards students prepare their annual and classes test from these online test and Short question answer series. In coming days we have many other plans to provide all kinds of other preparation on our Gotest website.

to Prepare KPK Board Classes Short Question Answer at Gotest

Just Open the desired Class and subject which you want to prepare.
You have Green bars which are Questions of that subject Chapter. Just click on Bar, it slides down and you can get the right answer to those questions.

What is the use of format specifiers? Give examples.

Ans. In C – language, a format specifier is the conversion specification code. It is used in input / Output functions to specify the format of Input / Outputs. It consists of one or two alphabets with % sign. Different format specifiers are used to specify different data type. The most common are %d, %f, %c etc.
It is used to represent “Integer” values. For example printf(“The Sum of 10 and 20 is %d”, 10+20);
Output: The sum of 10 and 20 is 30
It is used to represent “Float values. For example
Printf(“The Sum of 2.5 and 6.3 is %f”,2.5 + 6.3);
Output: The Sum of 2.5 and 6.3 is 8.8
It is used to represent single “Character” value. For example
Printf(“The first character of Allah is %c”, ‘A’);
Output: The first character of Allah is A.

Why escape sequences are used? Give examples.

Escape sequences are special non printable characters that are used in C – language to control the printing of an output devices. These can be used everywhere in the string. An escape sequence is combination of two characters. The first character is always backslash “ \’ while the second character may be different English letter.
The most commonly used escape sequences in C – language are following
\ n: It is used for new line. It shifts the coming text to next line. For example
Printf(“Allah is One \nElse is None”);
It will output as
Allah is One
Else is None
\t: It is used to insert a “tab” between text/sentence. For example
Printf(“Allah is One \ t Else is None”);
It will output as
Allah is One Else is None
\a: It is used to create a beep. For example
Printf(“My city Name is \ a D.I.Khan”);
It will create a beep after printing “My city name is” and before “D.I.Khan”).

What is the purpose of gets () function.

In C /C ++ language, gets() is an input function used to read the entire string from the keyboard during the program runtime and then store it to relevant string (Array of characters).
The difference between gets() and scanf() function is that scanf() does not read the blank space or the characters after it while the gets() allows the blank spaces used in string message. No format specifiers are used in gets() function.
Gets (variable name);
Following C –program explain the use gets() function.
Void main [ ]
Char name 1[25];
Char name2[25];
Printf(“Enter two names with spaces\n”);
Printf(“The frist name is %s”,name1);
Printf(“The Second name is %s”, name2);
This program will create output as
Enter tow names with spaces
Muhammad Umar Naeem
Muhammad Amjad Nadeem
The first name is Muhammad Umar Naeem
The Second name is Muhammad.

Differentiate between getch() and getche() functions?

Both getch() and getche() functions are input functions used to read a single character / letter from keyboard during runtime and can store it to a variable. The only different is that getch() reads the character with no echo i.e. without displaying the character on screen while the getche() reads the character with echo i.e. displaying the character on screen.
Following C – program explains the used of getch() and getche() functions.
Void main []
Char ch1,ch2;
Printf(Enter any character:”);
Ch1 = getch[]
Printf (“ \ n”);
Printf(Enter any other character:”);
Ch2 = getche ();
Printf (“\n”);
Enter any character:
Enter any other character: g

Evaluate the following expressions.

(A) 9 – 5 * (6 + 2)
= 9 – 5 * 8 (in this step () are evaluated)
= 9 – 40 ( in this step * is evaluated)
= – 31 ( in this step – evaluated)
(B) 60 / 10 * 24 + 3
= 6 * 24 + 3 ( in this step / is evaluated)
= 144 + 3 (in this step * is evaluated)
= 147 (in this step + is evaluated)
© 100%50 – 100%3
=0-100% 3 (in this step left % is evaluated)
= 0- 1 (in this step % is evaluated)
= -1 (in this step – is evaluated)

Differentiate between simple and compound assignment operations.

Ans. Both the simple and compound assignment operation are used to assign a new value to a variable. Simple Assignment operator consists of single symbol “=” with arithmetic operators. Simple assignment operator assigns a value to variable while the compound assignment operators perform mathematical operators and then assign the value to variables.
Example: a = 5;
Here the value ‘5’ is assigned to variable ‘a’ using simple assignment operator (=)
A = 4 ;
A + = 2;
Here the value ‘6’ is assigned to variable ‘a’ using compound assignment operator (+=).
The statement “a+ = 2” is equivalent to “a = a + 2 “
Similarly the compound assignment operators like- =, *=. / = may also be used.

You Can Learn and Gain more Knowledge through our Online Quiz and Testing system Just Search your desired Preparation subject at Gotest.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button