Ecua 1er Grado
2
Se desea diseñar un algortimo que me permita hallar la soluciion a una ecuación de 1er grado con una incognita ax+b=0 Donde x= (-1)*b/a Inicio Leer a,b si(a=0)entonces No hay solucion sino si(b=0) entonces x=0 sino x= -1*b/a Fin del si fin del si inicio a,b a=0 Sin Solucion V b=0 x=0 x=(-1)*b/a x fin
-
Upload
dany-castro -
Category
Documents
-
view
14 -
download
0
description
ECUACIONES
Transcript of Ecua 1er Grado
![Page 1: Ecua 1er Grado](https://reader036.fdocuments.co/reader036/viewer/2022081803/563dba90550346aa9aa6b4a3/html5/thumbnails/1.jpg)
Se desea diseñar un algortimo que me permita hallar la soluciion a una ecuación de 1er grado con una incognita ax+b=0Donde x= (-1)*b/aInicioLeer a,bsi(a=0)entonces No hay solucion sino si(b=0) entonces x=0 sino x= -1*b/aFin del si fin del si
inicio
a,b
a=0
Sin Solucion
V
b=0
x=0x=(-1)*b/a
x
fin
![Page 2: Ecua 1er Grado](https://reader036.fdocuments.co/reader036/viewer/2022081803/563dba90550346aa9aa6b4a3/html5/thumbnails/2.jpg)
#include<iostream.h>#include<conio.h>#include<stdlib.h>main(){float a, b,xcout<<« a= »;cin>>a;cout<<« b= »;cin>>b; if(a==0){ cout<<«No Hay solucion»exit(0);}else if(b==0) x=0; else x=(-1)*b/a;cout<<«El Valor de x= »<<x;getch();}