victorialais

Questão 14. media com presença

Aug 19th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.59 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     float nota1, nota2, nota3, media, presenca;
  7.     media = 0;
  8.   printf("Digite a primeira nota: ");
  9.   scanf ("%f", &nota1);
  10.    printf("Digite a segunda nota: ");
  11.   scanf ("%f", &nota2);
  12.    printf("Digite a terceiraa nota: ");
  13.   scanf ("%f", &nota3);
  14.   printf ("Quantas aulas você assistiu? ");
  15.   scanf ("%f", &presenca);
  16.   media = ((nota1 + nota2 + nota3)/3);
  17.   printf ("media: %f", media);
  18.   if (media >= 6 && presenca>=40)  {
  19.    
  20.         printf ("\naluno aprovado");}
  21.           else {
  22.          printf ("\naluno reprovado");}
  23.    
  24.  
  25.   }
Advertisement
Add Comment
Please, Sign In to add comment