Search:

Type: Posts; User: CProgWiz

Search: Search took 0.00 seconds.

  1. How do I make a program remember what number it created laast time?

    I'm making a program where I use a function to solve a quadratic, and if the value of a is not zero, it checks if it it has real roots and I have to remember those numbers.

    The form is ax^2 + bx +...
  2. Replies
    4
    Views
    2,821

    I'm confused as to what I should declare "a" to...

    I'm confused as to what I should declare "a" to be, because when I said in the first part of my function:



    if(ret == EOF)
    return -999;


    then at the main part of my function I...
  3. Replies
    4
    Views
    2,821

    Error in my program, help!

    My program is supposed to take in an interger, and tell me if it's a prime number or not. If I enter something like "woof", it'll tell me that it is invalid and does not work.

    My program is as...
  4. Replies
    2
    Views
    1,230

    Damnnn, it isn't letting me delete this. ):

    Damnnn, it isn't letting me delete this. ):
  5. Replies
    2
    Views
    1,230

    Trying to print using an (array)?

    I'm pretty new at programming, so I'm not sure if it's called an array exactly, but I want to print my output so it does the following:

    The ball strikes at:
    x m
    b m
    y m

    So far I have written...
  6. Actually yeah I did do that now...

    Actually yeah I did do that now hahahahahahhahahahahaha
  7. for (n = 1; n

    for (n = 1; n <= 50; n += 1)
    printf("%8d %8d %8d\n", n, n * n, n * n * n);


    What is the value of n for the above for loop?[/QUOTE]


    For that I meant to type, what value is n once the above...
  8. For the first one, I think it would be sum+ =...

    For the first one, I think it would be

    sum+ = ++n
    because in the first part, n++ is before the sum+=n.

    For the second one, I think the final value of n will be 50, because it says n<= 50,...
  9. I have a midterm tomorrow and I'd like to know if I have these questions right.

    The example from the previous slide was:


    sum = n = 0;
    while (sum <= 1000)
    {
    n++;
    sum += n;
    }
    printf("The first sum > 1000 is %d, and n is %d\n", sum, n);
Results 1 to 9 of 9