⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 practica1_8b.cpp

📁 Topics Practices: Programming and Numerical Methods Practice 1: Introduction to C Practice 2
💻 CPP
字号:
#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
  float a,b,c,x,y,z;
  printf("Encunentre la cantidad de raices reales y sus valores de la ecuacion ax`2+bx+c=0 \n");
  getch();
  printf("Dame el valor de a= ");
  scanf("%f", &a);
  printf("Dame el valor de b= ");
  scanf("%f", &b);
  printf("Dame el valor de c= ");
  scanf("%f", &c);  
  x=(-b+sqrt(b*b-4*a*c))/2*a;
  y=(-b-sqrt(b*b-4*a*c))/2*a;
  z=b*b-4*a*c;
     if(x==0)
  printf("La ecuacion tiene una sola raiz real y su valor es %.2f",x);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
if(x!=y)
  printf("La ecuacion tiene dos raices reales %.2f y %.2f",x,y);
getch();
}  

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -