(Meta 4) ejemplo calcular la mitad de un numero dev c++
- 1. #include <stdio.h>
#include <stdlib.h>
float multi(float m);
float dividir(float d);
int main(int argc, char *argv[])
{
int a;
float M,D;
printf("Ingrese un n%cmero:t",163);
scanf("%d",&a);
if(a<=5)
{ M=multi(a);
printf("Su numero es %.2f",M);
}
else {
D=dividir(a);
printf("Su numero es %.2f",D);
}
system("PAUSE>null");
return 0;
- 2. }
float multi (float m)
{
float total1;
total1=m*4;
return total1;
}
float dividir (float d)
{
float total2;
total2=d/2;
return total2;
}