-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaverage3integer200.cpp
More file actions
31 lines (29 loc) · 882 Bytes
/
average3integer200.cpp
File metadata and controls
31 lines (29 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
The sum && average of three Integer.
1.Start.
2.Take three input.
3.Make sum of three number.
4.Make average of three number.
5.Show average in output.
5.End.
*/
#include <iostream>
using namespace std;
//This function will produce the Average of number's.
//The function that Takes Something,Returns Nothing.
void average(int, int, int); //Globar Declaration.
int main()
{
//void average(int, int, int); --> Local Declaration.
int num1, num2, num3;
cout <<"Enter three number to find Average :" <<endl;
cin >> num1 >> num2 >> num3;
average(num1, num2, num3); //Function call with actual argument && call by value.
}
//Function Defination.
void average(int num1, int num2, int num3){
float average, sum;
sum = num1+num2+num3;
average = sum/3;
cout << "Average is = " << average;
}