Include

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Include as PDF for free.

More details

  • Words: 253
  • Pages: 2
#include <stdio.h> #define LIM 8 int monedas[LIM]= {500, 200, 100, 50, 25, 10, 5, 1}; main() { int num , cantidad, monedas; printf ("Introduzca el importe exacto: "); scanf ("%d", &cantidad); printf ("El cambio en monedas exactas es el siguiente : \n"); for (num=0; num main(void) { int potencia,e; potencia=1; e=0; while(potencia<=8) { potencia=potencia*2; e=e+1; //e es el exponente } printf("%d",e); getch (); return 0; } #include <stdio.h> #define MAX_RADIO 4.0 #define PI 3.141592 double AreaEsfera(double radio); main(){ double radio; puts("Esfera"); for (radio=0.0; radio <= (double) MAX_RADIO; radio +=0.2) volumen = printf("\t%6.2lf\t%6.3lf\t%6.3lf\n",radio,AreaCirculo(radio),AreaEsfera(radio)); } double AreaCirculo(double radio) {

double area; area = PI * (radio * radio); return(area); } double AreaEsfera(double radio) { double area; area = 4.00 * PI * (radio * radio); return(area); } double radio; puts("\n\t=== Tabla de Areas ===\n"); puts("\tRadio\tCirculo\tEsfera"); puts("\t-----\t-------\t------"); for (radio=0.0; radio <= (double) MAX_RADIO; radio +=0.2) printf("\t%6.2lf\t%6.3lf\t%6.3lf\n",radio,AreaCirculo(radio),AreaEsfera(radio)); } double AreaCirculo(double radio) { double area; area = PI * (radio * radio); return(area); } double AreaEsfera(double radio) { double area; area = 4.00 * PI * (radio * radio); return(area); } { double radio; puts("\n\t=== Tabla de Areas ===\n"); puts("\tRadio\tCirculo\tEsfera"); puts("\t-----\t-------\t------"); for (radio=0.0; radio <= (double) MAX_RADIO; radio +=0.2) printf("\t%6.2lf\t%6.3lf\t%6.3lf\n",radio,AreaCirculo(radio),AreaEsfera(radio)); } double AreaCirculo(double radio) { double area; area = PI * (radio * radio); return(area); } double AreaEsfera(double radio) { double area; area = 4.00 * PI * (radio * radio); return(area); }

Related Documents

Include
November 2019 10
Include
August 2019 18
Include 1
May 2020 4
Include 10
May 2020 6