Problem
Write a function prototype and definition for the following components:- A function that divides two numbers and returns the remainder
- A function that finds the larger of two numbers and returns the result
- A function that prints an ATM menu (it receives no parameters and returns no value)
Solution - Code
#include<stdio.h>#include<conio.h>
#include<stdlib.h>
void divi();
void lrg();
void atm();
main()
{
divi();
lrg();
atm();
system("pause");
}
void divi()
{
int r,x,y;
printf ("Enter two numbers : ");
scanf ("%d%d",&x,&y);
r = x%y;
printf("The remainder : %d\n",r);
system("pause");
}
void lrg()
{
int x,y;
printf("Enter two numbers : ");
scanf("%d%d",&x,&y);
if (x > y)
printf ("%d is greater than %d\n",x,y);
else
printf ("%d is greater than %d\n",y,x);
system("pause");
}
void atm()
{
printf("1.cash withdrawl\n");
printf("2. Fast cash\n");
printf("3. Balance inquiry\n");
printf("4.Transictiobn receipt\n");
}
No comments :
Post a Comment
Note: Only a member of this blog may post a comment.