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

📄 integral.cpp

📁 Topics Practices: Programming and Numerical Methods Practice 1: Introduction to C Practice 2
💻 CPP
字号:
//INTEGRAL 2
#include<stdio.h>
#include<conio.h>
#include<math.h>
float f(float x)
{
      return 3*x*x;
}
float integral(float a, float b, float h)
{
      float x,suma;
      suma=0;
      for(x=a; x<=b; x=x+h)
      suma=suma+h*f(x);
      return suma;   
}
main()
{
      float a,b,h,area;
      printf("Ingrese el extremo izquierdo: ");
      scanf("%f", &a);
      printf("Ingrese el extremo derecho: ");
      scanf("%f", &b);
      printf("Ingrese el paso de integracion: ");
      scanf("%f", &h);
      area=integral(a,b,h);
      printf("El area es: %f \n",area);
      getch();
}             
                    
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      

⌨️ 快捷键说明

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