Click to See Complete Forum and Search --> : c++ program


April 7th, 1999, 07:19 PM
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.

April 8th, 1999, 01:31 AM
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