Class 10 Computer Chapter 2 Notes
Complete Class 10 Computer Chapter 2 Notes User Interaction in 10th Class Computer Science English and Urdu Medium. These computerized notes are very helpful in the preparation of Class 10 Computer Chapter 2 Notes for students of the 10th class Computer Science and these are according to the paper patterns of all Punjab boards.
Summary and Contents:
Topics which are discussed in the notes are given below:
- Important 10 class computer chapter 2 mcqs for all students of Punjab Textbook Board.
- Important Multiple Choice Questions ( MCQs ) with correct Answers of Chapter No. 2: User Interaction in Computer Science class 10th Urdu Medium.
- Important class 10 computer chapter 2 notes pdf for all students of Punjab Textbook Board.
- Important Short Questions with Correct Answers of Chapter No. 2: User Interaction in Computer Science class 10th Urdu Medium.
- Important class 10 computer chapter 2 important questions for all students of Punjab Textbook Board.
- getch(): getch() function is used to read a character from user. The character entered by user does not get displayed on screen.
- Important class 10 computer chapter 2 exercise solutions for all students of Punjab Textbook Board.
- This function is generally used to hold the execution of program because the program does not continue further until the user types a key. To use this function, we need to include the library conio.h in the header section of program.
- Important class 10 computer chapter 2 question answer for all students of Punjab Textbook Board.
- EXAMPLE CODE: #include , #include , void main () , { printf("Enter any key if you want to exit program"); , getch(); }
- In the above, program prompts user to enter a character and then waits for the user's input before finishing the execution of program.
- Important class 10 computer chapter 2 programming exercise for all students of Punjab Textbook Board.
- EXAMPLE CODE: #include , #include , void main () , { char key; printf("Enter any key: "); , key = getch(); //Gets a character from user into variable key }
- Important class 10 computer notes chapter 2 for all students of Punjab Textbook Board.
- If we run this program, we notice a difference between reading a character using scanf and reading a character using getch functions. When we read character through scanf, it requires us to press enter for further execution.
- Important class 10 computer chapter 2 short question answer for all students of Punjab Textbook Board.
- But in case of getch, it does not wait for enter key to be pressed. Function reads a character and proceeds to the execution of next line.
- Important class 10 computer chapter 2 exercise solutions pdf for all students of Punjab Textbook Board.
- Statement Terminator: A statement terminator is identifier for compiler which identifies end of a line. In C language semi colon (;) is used as statement terminator. If we do not end each statement with a; it results into error.
- Important class 10 computer chapter 2 exercise for all students of Punjab Textbook Board.
- Escape Sequence: Purpose: Escape sequences are used in printf function inside the " and ". They force printf to change its normal behavior of showing output. Let's understand the concept of an escape sequence by looking at the following example statement: printf("My name is \"Ali\""); , The output of above statement is, My name is "Ali" , In the above example \" is an escape sequence. It causes printf to display " on computer screen.
- Important class 10 computer chapter 2 long question answer for all students of Punjab Textbook Board.
- Formation of escape sequence: Escape sequences consist of two characters. The first character is always back slash () and the second character varies according to the functionality that we want to achieve. Back slash (\) is called escape character which is associated with each escape sequence to notify about escape.
- Important class 10 computer chapter 2 exercise solutions pdf download for all students of Punjab Textbook Board.
- Escape character and character next to it are not displayed on screen, but they perform specific task assigned to them.
- New Line (\n): After escape character, in specifies movement of the cursor to start of the next line. This escape sequence is used to print the output on multiple lines. Consider the following example to further understand this escape sequence:
- Important class 10 computer chapter 2 exercise solutions urdu medium for all students of Punjab Textbook Board.
- EXAMPLE CODE: #include , void main() , { printf("My name is Ali. \n"); , printf("I live in Lahore."); } , Output , My name is Ali. I live in Lahore.
- Important Note: In the absence of an escape sequence, even if we have multiple printf statements, their output is displayed on a single line. Following example illustrates this point.
- Important class 10 computer chapter 2 important long questions for all students of Punjab Textbook Board.
- EXAMPLE CODE: #include , void main() , { printf("My name is"); , printf("Ahmad"); } , Output, My name is Ahmad
- Important class 10 computer chapter 2 extra questions for all students of Punjab Textbook Board.
- Tab (\t): Escape sequence \t specifies the I/O function of moving to the next tab stop horizontally. A tab stop is collection of 8 spaces. Using \t takes cursor to the next tab stop. This escape sequence is used when user presents data with more spaces.
- Important class 10 computer chapter 2 question answer for all students of Punjab Textbook Board.
- Operators: The name computer suggests that computation is the most important aspect of computers. We need to perform computations on data through programming. We have a lot of mathematical functions to perform calculations on data. We can also perform mathematical operations in our programs. C language offers numerous operators to manipulate and process data. Following is the list of some basic operator types:
- Important class 10 computer chapter 2 summary for all students of Punjab Textbook Board.
- Assignment operator, Arithmetic operators, Logical operators, Relational operators