#include <stdio.h>
main ()
//Diego Zebadua
{
float n1;
float n2;
float r;
int menu;
printf("Ingresa un numero \n");
scanf("%f", &n1);
printf("Ingresa otro numero\n");
scanf("%f", &n2);
printf("�Que opcion eliges? \n");
printf("1.Sumar. \n");
printf("2.Restar. \n");
printf("3.Multiplicar. \n");
printf("4. Dividir. \n");
scanf("%d", &menu);
switch (menu)
{
case 1:
r= n1+n2;
printf("La suma es: %f",r);
break;
case 2:
r=n1-n2;
printf("La resta es: %f", r);
break;
case 3:
r=n1*n2;
printf("La multiplicacion es: %f", r);
break;
case 4:
r=n1/n2;
printf("La division es: %f", r);
break;
default:
printf("Opcion no valida");
break;
}
}
To embed this project on your website, copy the following code and paste it into your website's HTML: