Documentos de Académico
Documentos de Profesional
Documentos de Cultura
Practica HClases JesusRamirez
Practica HClases JesusRamirez
/*1.- Hacer un programa que muestre un menú donde las opciones sean “Triángulo”,
“Rectángulo” “Círculo” y “Cuadrado”, pida una opción y calcule el área de la figura
seleccionada, mostrar mensaje de error al seleccionar una opción distinta a las
indicadas anteriormente. */
#include<conio.h>
#include<stdio.h>
#include<windows.h>
#include<locale.h>
int main()
{
float l,b,b2,h,h2,r,A2,A4,triangulo,rectangulo,circulo,cuadrado;
int menu,A1,A3,d;
system("color 8A");
setlocale(LC_ALL,"spanish");
printf("\n\n\n\n\t\tSeleccione la opcion deseada 1,2,3 o 4 para saber su área.");
printf("\n\n\n\t1 cuadrado ");
printf("\n\n\n\t2 triangulo ");
printf("\n\n\n\t3 rectangulo ");
printf("\n\n\n\t4 circulo ");
printf("\n\n\n\tEscriba la opcion que desea... ");
scanf("%d",&menu);
if (menu==1)
{
printf("\n\n\n\t\tEscriba el valor del lado del cuadrado:");
scanf("%f",&l);
A1 = l*l;
printf("\n\n\n\t\tEl área es %d",A1);
}
else
if (menu==2)
{
printf("\n\n\n\t\tEscriba el valor de la base:");
scanf("%f",&b);
FUNDAMENTOS DE PROGRAMACIÓN.
JESÚS RAMÍREZ ÁLVAREZ
1° ”B” SISTEMAS COMPUTACIONALES.
PROFESORA LUZ ELBA CASTILLO IZQUIERDO.
}
FUNDAMENTOS DE PROGRAMACIÓN.
JESÚS RAMÍREZ ÁLVAREZ
1° ”B” SISTEMAS COMPUTACIONALES.
PROFESORA LUZ ELBA CASTILLO IZQUIERDO.
FUNDAMENTOS DE PROGRAMACIÓN.
JESÚS RAMÍREZ ÁLVAREZ
1° ”B” SISTEMAS COMPUTACIONALES.
PROFESORA LUZ ELBA CASTILLO IZQUIERDO.
FUNDAMENTOS DE PROGRAMACIÓN.
JESÚS RAMÍREZ ÁLVAREZ
1° ”B” SISTEMAS COMPUTACIONALES.
PROFESORA LUZ ELBA CASTILLO IZQUIERDO.
FUNDAMENTOS DE PROGRAMACIÓN.
JESÚS RAMÍREZ ÁLVAREZ
1° ”B” SISTEMAS COMPUTACIONALES.
PROFESORA LUZ ELBA CASTILLO IZQUIERDO.
de las dos más baratas. Haga un programa que, dados los tres precios de las
#include<stdio.h>
#include<conio.h>
#include<windows.h>
int main()
int P1,P2,P3,PRE1,PRE2,PRE3,TP;
system("color 10");
scanf("%d",&PRE1);
scanf("%d",&PRE2);
scanf("%d",&PRE3);
if(PRE1>PRE2&&PRE1>PRE3)
TP=PRE2+PRE3;
else if (PRE2>PRE1&&PRE2>PRE3)
TP=PRE1+PRE3;
else
{
FUNDAMENTOS DE PROGRAMACIÓN.
JESÚS RAMÍREZ ÁLVAREZ
1° ”B” SISTEMAS COMPUTACIONALES.
PROFESORA LUZ ELBA CASTILLO IZQUIERDO.
TP=PRE1+PRE2;