No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
I am working on an assignment to get an intiger from user, find all prime numbers smaller that it, and show all of them which dont contain a '1'. for breaking the integer into digits, I am using " x / 10 % 10 " algorythem, but I as it … |
|
what is wrong with this code? [color=#0000ff]int[/color][color=#000000] myFunction([/color][color=#0000ff]int[/color][color=#000000] b)[/color] { [color=#0000ff]int[/color][color=#000000] c;[/color] [color=#0000ff]double[/color][color=#000000] z = b;[/color] [color=#0000ff]double[/color][color=#000000] d;[/color] [color=#0000ff]int[/color][color=#000000] y=0;[/color] [color=#0000ff]while[/color][color=#000000] (d<0)[/color] { d= (z/pow(10,y)); c = ([color=#0000ff]int[/color])d; c = c%10; [color=#0000ff]if[/color][color=#000000] (!(c=1))[/color] ++y; [color=#0000ff]else[/color] b=0; } [color=#0000ff]return[/color][color=#000000] b;[/color] } The compiler gets 3 erros of the pow(): - math.h(575): … |