الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

problem finding the Derivative

بدأه aibrahem في 19 نوفمبر 2010 · 1 رد · 464 مشاهدة · في الأسئلة المجابة
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

sallam alikom , sorry but my computer doesn't support arabic letters

I have an assignment to find the first derivative of a function . . .

this is my work ,but I think I have a logic error since it compiled perfectly without errors

#ifndef f1_h
#define f1_h

double deriv(int x , double dx);

#endif

#include "f1.h"



double deriv(int x ,double dx )

{

  return (x+dx)-(x)/dx;
}

#include <iostream>
#include "f1.h"
#include "f2.h"
using namespace std;


int main()
{
	int x;
	const double dx=0.000001;

	cout<<"enter your function :\n";
	cin>>x;



    deriv( x , dx );
	print( x , dx );


	 return 0;
}

#ifndef f2_h
#define f2_h

void print(int x ,double dx);
#endif

#include "f2.h"
#include <iostream>
using namespace std;

void print(int x ,double dx)
{
	cout<<"f'(x) = "<<((x+dx)-(x))/dx<<endl;
}
#2

ma32ool ma 7ada bedo yesa3ed

مواضيع مشابهة