Search:

Type: Posts; User: askinne2

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    8,474

    You need to run the calculation of the grade for...

    You need to run the calculation of the grade for all k < 20. And here is working code for what you want. Please make sure you understand what it is doing and feel free to ask if you don't. Notice...
  2. Replies
    6
    Views
    3,655

    Thanks, I can't believe I didn't put that inside...

    Thanks, I can't believe I didn't put that inside the loops. Anyways, it's still coming up with the wrong answer. It comes up with a long list of answers that don't fit the Pythagorean theorem. Like...
  3. Replies
    6
    Views
    3,655

    Pythagorean Triplet Problem

    I am solving the euler probelm (no. 9) that wants to find the only Pythagorean triplet such that a+b+c = 1000. Does anyone see what is wrong with my code? It looks like it should work to me...


    ...
  4. Replies
    12
    Views
    11,445

    I didn't realize that Euler's problem was to find...

    I didn't realize that Euler's problem was to find the 10,001st prime and not the 1,001st prime, lol. That is the 1,001st prime number. Thanks again
  5. Replies
    12
    Views
    11,445

    I just was trying to make a simple program that...

    I just was trying to make a simple program that did what it had to do, and then I will go and try to make it efficient.
  6. Replies
    12
    Views
    11,445

    Thanks KBriggs. That works perfectly :)

    Thanks KBriggs. That works perfectly :)
  7. Replies
    7
    Views
    943

    Did you look up 2 dimensional arrays? Try to...

    Did you look up 2 dimensional arrays? Try to write the program using one.
  8. Replies
    17
    Views
    1,750

    Yeah, Adak's solution is your best option. I had...

    Yeah, Adak's solution is your best option. I had to do it before. You can just write a function (call it intCast or something like that) that will add .5 to the number and then type cast to the int.
  9. Replies
    12
    Views
    11,445

    I forgot to post the code where I corrected that....

    I forgot to post the code where I corrected that. Anyways, my answer isn't coming out correct still. Anyone know what's wrong with this code for finding the 1001st prime number?



    #include...
  10. Replies
    17
    Views
    1,750

    Woops, sorry. I didn't notice that I guess. To be...

    Woops, sorry. I didn't notice that I guess. To be honest, I don't know why it is getting 3 with the type cast. When a solution is posted I will be sure to take note :)
  11. Replies
    7
    Views
    943

    Woops - didn't know I was speaking with the OP...

    Woops - didn't know I was speaking with the OP himself, haha. Well there is fgets(); if you want to use that.
  12. Replies
    17
    Views
    1,750

    I found your problem. You can't just say take it...

    I found your problem. You can't just say take it to the 1/3 power. You need to make 1/3 into a double type and then take it to that power. Here is some working code for you...



    int main()
    {
    ...
  13. Replies
    17
    Views
    1,750

    It must not be evaluating to exactly 4. Maybe...

    It must not be evaluating to exactly 4. Maybe it's evaluating to 3.9999999 or something. Typecasting a double to a int will truncate the value. Meaning, it will just chop of the decimal places...
  14. Replies
    7
    Views
    943

    True. I don't know what I was thinking :) @OP...

    True. I don't know what I was thinking :)

    @OP - You should look into 2-dimensional arrays. I think that is the point of this exercise. You will need to use a 2 for loops (nested) that will loop...
  15. Replies
    7
    Views
    943

    Do you know about 2-dimensional arrays? ...

    Do you know about 2-dimensional arrays?

    myArray[5][5];
  16. Replies
    17
    Views
    1,750

    double root = pow( num, 1 / 3.0 ) ; Why is it...

    double root = pow( num, 1 / 3.0 ) ;

    Why is it num ^ 1/3? Instead it should be pow(num, 3) right?
  17. Replies
    5
    Views
    1,378

    Here is your program with some printf statements...

    Here is your program with some printf statements that will output what troco is holding at each point in your program. Take a look at the values you are getting when you run it and see if you can...
  18. Replies
    15
    Views
    1,859

    You could simply ask the user how many students...

    You could simply ask the user how many students they need and use this number as the size of your array.
  19. Replies
    12
    Views
    11,445

    Take a look at my new code, it has some comments...

    Take a look at my new code, it has some comments where I ask questions in it. Do you minding answering those for me?
  20. Replies
    12
    Views
    11,445

    Prime Number Function

    I am having a bit of trouble creating a function that will determine if a number is a prime number or not. I have attempted various ways to do this, and have read up on the Seive of Eratosthenes....
  21. Replies
    6
    Views
    4,959

    This looks awesome! I am going to start these...

    This looks awesome! I am going to start these right away. Has anyone here been able to solve all of them or a large amount of them?
  22. Replies
    6
    Views
    4,959

    Exercises For Better Programming

    Hey guys, I am in school for Computer Science. I enjoy programming and really want to develop into a strong programmer. Please post exercises (for C) that will make me a better programmer.

    I am a...
  23. Replies
    20
    Views
    13,276

    Well when I graph sin(x) for instance, the...

    Well when I graph sin(x) for instance, the function for all x<0 seems to plot fine. But on the x>0 side it seems to distort. Do you think you can see why in my code?


    #include <math.h> //for use...
  24. Replies
    20
    Views
    13,276

    Perfect, it is working very nicely now. The only...

    Perfect, it is working very nicely now. The only imperfection is that I need to space out the intervals (such as x1 x2 x3 etc being too close). Because they are too close it causes graphs like sin(x)...
  25. Thread: Truncation

    by askinne2
    Replies
    5
    Views
    2,811

    Sure, it is loss of precision. But if you think...

    Sure, it is loss of precision. But if you think about it, we are losing precision on nearly everything all of the time. ;)

    Why are you worried about it?
Results 1 to 25 of 46
Page 1 of 2 1 2