Advertisement
Guest User

Untitled

a guest
Jan 24th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6.  
  7. int notaExamenScris, notaLaborator, notaSeminar, flag=0;
  8. double notaFinala;
  9.  
  10. printf("Nota examen scris: ");
  11. scanf("%d", &notaExamenScris);
  12. printf("Nota laborator: ");
  13. scanf("%d", &notaLaborator);
  14. printf("Nota seminar: ");
  15. scanf("%d", &notaSeminar);
  16. notaFinala = 0.5 * notaExamenScris + 0.3 * notaLaborator + 0.2 * notaSeminar;
  17.  
  18. if(notaExamenScris <= 5 || notaLaborator <= 5 || notaFinala <= 5){
  19. flag = 1;
  20. }
  21.  
  22. if (flag == 1){
  23. printf("Marinel a avut nota %.1f. Nepromovat", notaFinala);
  24. } else{
  25. printf("Marinel a avut nota %.1f. Promovat", notaFinala);
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement