P
Profetas
Hi I am using this function to power numbers
int power (int m, int n);
int power (int base, int n) {
int i,
p;
p = 1;
for (i = 1; i <= n; ++i)
p *= base;
return p;
}
but my problem is that I need to power using 1.05 or 2.33
and this isn't working.
Should I use float?
another question.
is there any function call to clear the screen?
(I was using the system(clear); but it is not compatible
with other systems.
is there any way to read the user return?
like
printf("press return to go back to menu");
wait_return=getchar();
???
Thanks Profetas
int power (int m, int n);
int power (int base, int n) {
int i,
p;
p = 1;
for (i = 1; i <= n; ++i)
p *= base;
return p;
}
but my problem is that I need to power using 1.05 or 2.33
and this isn't working.
Should I use float?
another question.
is there any function call to clear the screen?
(I was using the system(clear); but it is not compatible
with other systems.
is there any way to read the user return?
like
printf("press return to go back to menu");
wait_return=getchar();
???
Thanks Profetas