Ir para conteúdo
Fórum Script Brasil

davidk.

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Posts postados por davidk.

  1. #include <stdio.h>
    #include <stdlib.h>

    float altura (float altx, float alty);
    float altura2 (float altx, float alty);
     
     main()
    {
        float a,b,c;
        char ch;

      printf("QUAL O SEU SEXO [f/m]: ");
      scanf(" %c", &ch);
            fflush(stdin);
        printf ("Digite a altura de seu pai : ");
        scanf(" %d", &a);
        fflush(stdin);
        printf ("Digite a altura de sua mae: ");
        scanf(" %d", &b);
        fflush(stdin);
        
      ch=toupper (ch);
      if (ch == 'M'){
          c=altura(a,b);
            printf(" %.2f\n",c);
        
          
        }else{
          
            printf(" %.3f\n",altura2(a,b));

        }
        
    system("pause");
    return 0;
    }

    float altura (float altx, float alty)
    {
        return altx+alty+13/2;
        
    }

    float altura2 (float altx, float alty)
    {
        return (altx+alty-13) /2;
        
    }

×
×
  • Criar Novo...