10th Class Computer Chapter 5 Urdu Medium
Important full 10th Class Computer Chapter 5 Urdu Medium of Functions in 10th Class Computer Science Urdu Medium written by Honorable Mr. Wajid Ghani Suib. These computerized notes are very helpful in the preparation of 10th Class Computer Chapter 5 Urdu Medium 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 Multiple Choice Questions ( MCQs ) with correct Answers of Chapter No. 5: Functions in Computer Science class 10th Urdu Medium.
- Important Short Questions with Correct Answers of Chapter No. 5: Functions in Computer Science class 10th Urdu Medium.
- Students Learning Outcomes. After completing this unit students will be able to
- Explain the concept and types of functions
- Explain the advantages of using functions
- Explain the signature of function (Name, Arguments, Return type)
- Explain the following terms related to functions: Definition of a function, Use of a function
- Unit Introduction: A good problem solving approach is to divide the problem into multiple smaller parts or sub-problems. Solution of the whole problem thus consists of solving the sub-problems one by one, and then integrating all the solutions. In this way, it becomes easier for us to focus on a single smaller problem at a time, instead of thinking about the whole problem all the time.
- This problem solving approach is called divide and conquer. C programming language provides us with functions that allow us to solve a programming problem using the divide and conquer approach. In this chapter, we will learn the concept of functions, their advantages, and how to work with them.
- Functions: A function is a block of statements which performs a particular task, e.g. printf is a function that is used to display anything on computer screen, scanf is another function that is used to take input from the user. Each program has a main function which performs the tasks programmed by the user. Similarly, we can write other functions and use them multiple times.
- Types of Functions: There are basically two types of functions: 1) Built-inFunctions. 2) User Defined Functions
- Built-in Functions: The functions which are available in C Standard Library are called built-in functions. These functions perform commonly used mathematical calculations, string operations, input/output operations etc. For example, printf and scanf are built-in functions.
- User Defined Functions: The functions which are defined by a programmer are called user-defined functions. In this chapter we will learn how to write user defined functions.
- Advantages of Functions: Functions provide us several advantages.
- 1) Reusability: Functions provide reusability of code. It means that whenever we need to use the functionality provided by the function, we just call the function. We do not need to write the same set of statements again and again.
- 2) Separation of tasks: Functions allow us to separate the code of one task from the code of other tasks. If we have a problem in one function, then we do not need to check the whole program for removing the problem. We just need to focus at one single function.
- 3) Handling the complexity of the problem: If we write the whole program as a single procedure, management of the program becomes difficult. Functions divide the program into smaller units, and thus reduce the complexity of the problem.
- 4) Readability: Dividing the program into multiple functions, improves the readability of the program.
- Signature of a Function: A function is a block of statements that gets some inputs and provides some output. Inputs of a function are called parameters of the function, and output of the function is called its return value. A function can have multiple parameters, but it cannot return more than one values.
- Function signature is used to define the inputs and output of a function. The general strūcture of a function signature is as follows:
- return_type function_name (data_type1, data_type2,...,data_typeN);
- (data type of return value - return_type), (function identifier - function_name), (data types of function parameters - data_type1, data_type2,...,data_typeN)