#include <stdio.h>
/*
Franco jimenez 22235192-8
*/

float mayor(int n) 
{
    int i=1;
    float num, max; 
    
  while (i<n) 
    {
        printf("Ingrese el numero:");
        scanf("%f", &num);

        if (i==0) 
        {
            max = num;
        }
        else 
        {
            if (num>max)
            {
                max=num;
            }
        }

        i++;
    }
    return max;
}

int main() 
{
    int n;

    printf("Ingrese la cantidad de valores a ingresar: ");
    scanf("%i", &n);

    float resultado = mayor(n);

    printf("El mayor valor ingresado es %.2f\n", resultado);

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: