Guest User

Untitled

a guest
May 20th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.70 KB | None | 0 0
  1.   float media(float p1, float p2, float p3)
  2. {   float m;
  3.     return m=((p1+p2+p3)/3);
  4. }
  5.  
  6.     float principal(float m)
  7. {
  8.  
  9.         if(m>=7&&m<=10)
  10.             {return printf("aprovado");}
  11.     else{
  12.         if(5<=m<7)
  13.             {return printf("recuperacao");}
  14.     else{
  15.         if(m<5)
  16.             {return printf("reprovado");}
  17.     else{return 0;}
  18.     }
  19.     }
  20.     }
  21.  
  22.  
  23.     int main()
  24. {
  25.     float p1;
  26.     float p2;
  27.     float p3;
  28.     float m;
  29.     printf("Digite a p1 do aluno:\n");
  30.     scanf("%f",&p1);
  31.     printf("Digite a p2 do aluno:\n");
  32.     scanf("%f",&p2);
  33.     printf("Digite a p3 do aluno:\n");
  34.     scanf("%f",&p3);
  35.     printf("A situacao do aluno e':");
  36.     return principal(m);
  37. }
Add Comment
Please, Sign In to add comment