/tmp/cckrJitj.o(.text+0x119): In function `main':
: undefined reference to `pow'
collect2: ld returned 1 exit status
here is my code (it's ugly, and i know a lot of unnecessary steps due to debugging i've tried):
Code:#include <stdio.h> #include <math.h> int main() { int sevens = 0; int input = 0; int digits; int division = 10000000; int counter = 8; int x = 7; int go = 1; float power = 0; int mod = 1; int counter2 = 0; int y; int powerint = 0; printf("Welcome to the amazing 7 finder machine. Give me any number "); printf("and I can tell how many 7s are in it(Whole numbers only): "); scanf("%d", &input); while (go == 1) { if (input / division >= 1) { digits = counter; go = 0; } division /= 10; counter--; } for (counter = 1; counter <= digits; counter++) { y = digits - counter; power = pow(10, y); x = (input / power); if (x == 7) { sevens++; } for (counter2 = digits; counter2 >= counter; counter2--) { mod *= 10; } input = (input % mod); mod = 1; } printf("\nThere are %d sevens in your integer. Thanks!\n", sevens); return 0; }
please help, my deadline is tonight at midnight!!!



LinkBack URL
About LinkBacks



