CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: c++ program

  1. #1
    Guest

    c++ program


    I was wondering if someone could tell me how to write a program for the following.
    It is to print out all the values of the equation y=x^2+3x+2, and its derivative, y'=2x+3 for values between x=-5 to 5. Incrementing by 0.5.



  2. #2
    Guest

    Re: c++ program

    This sounds like a homework problem, so I'll give you as much coding help as I
    can. Well, here goes for the first few values:

    #include <stdio.h>

    int main() {
    printf("12, -7\n8.75, -6\n6, -5\n3.75, -4\n"
    "2, -3\n0.75, -2\n0, -1\n-0.25, 0\n"
    "0, 1\n0.75, 2\n2, 3\n3.75, 4\n");

    // You can fill in the rest

    }

    Regards

    Paul




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured