-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpractice1.c
More file actions
46 lines (33 loc) · 1.02 KB
/
practice1.c
File metadata and controls
46 lines (33 loc) · 1.02 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include<stdio.h>
#include<stdlib.h>
//greet the user
void Greeting();
//ask, get, and return an integer
int GetInteger();
//ask, get, and return a double
double GetDouble();
//calculates and returns the quotient of
//argument one divided by argument two
double FindQuo(double arg1, double arg2);
//calculates and returns the absolute value
//of the difference of two integers
int FindAbsoluteValue(int arg1, int arg2);
int main()
{
int num1, num2, absResMain;
double num3, num4, quotientMain;
//Greet the user by calling the Greeting function
Greeting();
//invoke or call the function to do the quotient calculation
quotientMain = FindQuo(num3, num4);
//print the results
printf("\nThe absolute value of %d minus %d is %d\n\n", num1, num2, absResMain);
printf("\n%.2f divided by %.2f is %.2f\n\n", num3, num4, quotientMain);
//say goodbye to the user
printf("\nGoodbye, Have a great day!\n");
return 0;
}
void Greeting()
{
printf("\nWelcome to the absolute value calc\n");
}