C programming, make it use a function call to print the smallest number?
hi guys
this is a program which prints out the smallest of three numbers within
the main function that I was asked to write.
Now the other question i am asked,5. Re-write the program, uses a function call to print the smallest number?
what do it mean if someone can explain or show me an example please
i am new to c
Code:
# include <stdio.h>
main()
{
int a,b,c;
int temp, min;
a = 100;
b = 23;
c = 5;
min = a;
temp = b;
if (min < temp)
{
min = temp;
temp = c;
if (min < temp)
{
min = temp;
printf (“\nThe minimum value of these three numbers is ”, min);
}
else
{
printf (“\nThe minimum value of these three numbers is “, min);
}
}
else
{
temp = c;
f (min < temp)
{
min = temp;
printf (“\nThe minimum value of these three numbers is ”, min);
}
else
{
printf (“\nThe minimum value of these three numbers is “, min);
}
}