16/11/2022 ; 5:28 PM
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
/* Función.
|
||||
El programa, al recibir como dato un valor entero, calcula el resultado de
|
||||
➥una función.
|
||||
|
||||
Y: variable de tipo entero.
|
||||
X: variable de tipo real. */
|
||||
|
||||
void main(void)
|
||||
{
|
||||
float X;
|
||||
int Y;
|
||||
printf("Ingrese el valor de Y: ");
|
||||
scanf("%d", &Y);
|
||||
if (Y < 0 | | Y > 50)
|
||||
X = 0;
|
||||
else
|
||||
if (Y <= 10)
|
||||
X = 4 / Y - Y;
|
||||
else
|
||||
if (Y <= 25)
|
||||
X = pow(Y, 3) - 12;
|
||||
else
|
||||
X = pow(Y, 2) + pow(Y, 3) - 18;
|
||||
printf("\n\nY = %d\tX = %.2f", Y, X);
|
||||
}
|
||||
Reference in New Issue
Block a user