how do i link all these function together in the main funtion so it can run? thank you
//
// main.c
// Assignment1
//
// Created by Hassan omer on 15/10/21.
//
#include <stdio.h>
# include <stdlib.h>
int input();
int multiples();
int cions();
void display_change();
int main() {
int num;
num = input();
multiples(num);
cions();
display_change();
return 0;
}
int input(int num)
{
printf("enter 5-95 number\n");
scanf("%d",&num);
return num;
}
int multiples(int num)
{
int sum5 =0;
if (sum5 %5 != 0 ||sum5<5|| sum5 >95) {
printf("invaild input %d",sum5);
}
cions(sum5);
return sum5;
}
int cions(int sum05){
int cent50 = 0;
int cent20 = 0;
int cent10 = 0;
int cent05 = 0;
if (sum05 > 0)
{
if (sum05 >= 50){
sum05 -= 50;
cent50++;
}
else if (sum05 >=20){
sum05 -= 20;
cent20++;
}
else if (sum05 >= 10){
sum05 -=10;
cent10++;
}
else if (sum05 >= 05){
sum05 -= 05;
cent05++;
}
else{
printf("error input");}
}
return (sum05);
}
void display_change(int sum05)
{
int cent50 = 0;
int cent20 = 0;
int cent10 = 0;
int cent05 = 0;
if (cent50)
printf("cent %d",cent50);
if(cent20)
printf("cent %d",cent20);
if(cent10)
printf("cent %d",cent10);
if(cent05)
printf("cent %d",cent05);
}
how do i link all these function together in the main funtion so it can run?
thank you
Step by step
Solved in 3 steps with 3 images