I need help building proto types for dividing, comparing, and an ATM menu that receives no paramaters, also building function definitions and function calls for each
here's one I have completed as an example unless you see an error yourself
Code
//- A function that divides two numbers and returns the remainder
#include <stdlib.h>
#include <stdio.h>
int imodulus(int, int); // function prototype
main ()
{
int num1;
int num2;
printf("\nEnter the first number: ");
scanf("%d", &num1);
printf("\nEnter the second number: ");
scanf("%d", &num2);
printf("\nThe result is %d\n", imodulus(num1, num2));
system ("pause");
}
// function definition
int imodulus(int num1, int num2)
{
return num1 / num2;
}
here is what I have for comparing two large numbers
Code
//- A function that finds the larger of two numbers and returns the result
#include <stdlib.h>
#include <stdio.h>
int CompareTwoNumbers(int,int); // function prototype
main ()
{
int num1;
int num2;
printf("\nEnter the first number: ");
scanf("%d", &num1);
printf("\nEnter the second number: ");
scanf("%d", &num2);
system ("pause");
}
//function definition
int CompareTwoNumbers (int num1, int num2)
{
return if (num1 < num2)
printf ("\n%d is less than%d\n", num1, num2);
else if (num1 == num2)
printf ("n%d is equal to %d\n", num1, num2);
else
printf ("\n%d is greater than %d\n", num1, num2);
}
and here is that I have for the ATM menu
Code
//- A function that prints an ATM menu—it receives no
//parameters and returns no value
void pMenu(void);
void pMenu();