1.1-exponencial(word) métodos numéricos matlab

2
#include<stdio.h> #include<conio.h> #include<math.h> float f(float x); int main() { float a,b,c,F,A,B,C; clrscr (); gotoxy (5,8); printf("valor a"); scanf("%f",&a); gotoxy(5,10); printf("valor b"); scanf("%f",&b); gotoxy(5,12);printf("valor c"); scanf("%f",&c); A=f(a); B=f(b); C=f(c); F=A+B+C; clrscr(); gotoxy(7,7); printf("a=%f b=%f c=%f",a,b,c); gotoxy(7,9); printf("F=%f",F); getch(); } float f(float x) { return(exp(8*x)-5*x+log(3*x)); }

Upload: alfredo-toriz

Post on 07-Dec-2015

247 views

Category:

Documents


0 download

DESCRIPTION

Práctica de métodos numericos

TRANSCRIPT

Page 1: 1.1-Exponencial(Word) Métodos numéricos MATLAB

#include<stdio.h>#include<conio.h>#include<math.h>

float f(float x);int main()

{

float a,b,c,F,A,B,C; clrscr (); gotoxy (5,8); printf("valor a"); scanf("%f",&a); gotoxy(5,10); printf("valor b"); scanf("%f",&b); gotoxy(5,12);printf("valor c"); scanf("%f",&c); A=f(a);

B=f(b);

C=f(c);

F=A+B+C; clrscr(); gotoxy(7,7); printf("a=%f b=%f c=%f",a,b,c); gotoxy(7,9); printf("F=%f",F); getch();}

float f(float x)

{

return(exp(8*x)-5*x+log(3*x));

}

Page 2: 1.1-Exponencial(Word) Métodos numéricos MATLAB