I am new to programing and I am trying to learn about functions, so I tried some questions with it to get a better understanding of it.
I am still unsure so right now I got stuck and i don't know how to continue.
I tried to make a first function in the main that has only the answers and that function calls a second function and the second one is calling to a third function
but I dont know how to fix this error i tried changing names but I am not sure what to do and even if i am doing is right the error I get is related to "void Ex1()" so what can I change?
int main()
{
Ex1();
}
void Ex1()
{
int num1, num2, num3,min;
printf("enter three diff numbers \n");
scanf("%d %d %d", &num1, &num2, &num3);
printf("%d", function1(min));
}
int function1(int sum)
{
int num1, num2, num3, min, max;
if (num1 > num2)
{
max = num1;
min = num2;
}
else
{
max = num2; min = num1;
}
if (num3 > max)
{
min = max;
max = num3;
}
if (num3 > min&& num3 < max)
{
min = num3;
}
return min;
}