Originally Posted by
countpuchi
Sorry im new here.. i cant seem to get the function working
Could you tell us what it's supposed to be doing? If you give us something broken, we can't look at what it does and assume that's what you want. We have to assume what you are giving us is not what you want, since you wouldn't be asking for help otherwise.
In short, what's the problem?
I'm guessing, but I think this is what you want:
Code:
#include <stdio.h>
void calc(int inch)
{
int rem_inch, feet;
feet = inch/12;
rem_inch = inch % 12;
printf("%d inches = %d feet %d inches\n", inch, feet, rem_inch);
}
int main(int argc, char *argv[])
{
int i, inch;
for(i=0;i<5;i++)
{
printf("\nPlease Enter Inches:");
scanf("%d", &inch);
calc(inch);
}
return 0;
}