Sie sind auf Seite 1von 3

Manual # 12

Topic:
Functions

Subject:
Introduction to Computing

Author:
Engr. Ali Faisal Murtaza
-----------------------------------------------------------------------------------------------------------
-
Q1: Write a program through function which will calculate the volume of the box. In this
program the values should be passed from the main. And the values should be input from
the keyboard.
-----------------------------------------------------------------------------------------------------------
-
Q2 Write a Program which will take the average of ten elements. Do it through functions.
-----------------------------------------------------------------------------------------------------------
-
Q3 Write a program which will multiply two 3 x 3 matrices.
Create Four functions:
1) Input in Matrix A
2) Input in Matrix B
3) Multiplication Function
4) Output Function
-----------------------------------------------------------------------------------------------------------
-
Q4 Write a program in which the sorting is done. This program should be done through
functions.
Create:
1) Input Function in Array
2) Output Function to Display the Original Array
3) Sorting Function
-----------------------------------------------------------------------------------------------------------
-
Q5: Write a program in which the searching should be done. Do this program through
functions.
Now, you should have enough knowledge to judge that how many functions are
needed to create in this program.
-----------------------------------------------------------------------------------------------------------
-
Q6: Write a program with following functions:
1) Input Function which will take the Input of five values from the User.
2) From Input function, another Summation function should be called, which
will sum these five values.
3) From Input function, another function Average Function should be called,
which will take the average of these five values.
4) From Average Function, Another Even-Odd Function should be called which
will tell that whether the Average Number is Even or Odd.
5) From Even-Odd Function, Another Function Neg-Pos should be called,
which will tell that the value is negative or positive.
6) From Average Function, Another Function should be called which will
display the average of five values.
-----------------------------------------------------------------------------------------------------------
-

Das könnte Ihnen auch gefallen