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 -
Category
Documents
-
view
247 -
download
0
description
Práctica de métodos numericos
Transcript of 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));
}