Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. problemas selectivos simples 1
  2.  
  3.  
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. /// 1) Determinar si un alumno aprueba a reprueba un curso,
  7. /// sabiendo que aprobara si su promedio de tres calificaciones es mayor o igual a 7; reprueba en caso contrario.
  8.  
  9. int notaAlumno = 0 ;
  10. int nota = 0 ;
  11. float promedioalumno = 0 ;
  12.  
  13. int main()
  14. {
  15. printf("ingrese nota 1 \n") ;
  16. fflush(stdin) ;
  17. scanf("%i" , &nota) ;
  18. notaAlumno= notaAlumno+nota;
  19. printf("ingrese nota 2 \n") ;
  20. fflush(stdin) ;
  21. scanf("%i" , &nota) ;
  22. notaAlumno=notaAlumno+nota ;
  23. printf("ingrese nota 3 \n") ;
  24. fflush(stdin) ;
  25. scanf("%i" , &nota) ;
  26. notaAlumno=notaAlumno+nota ;
  27.  
  28. promedioalumno=notaAlumno/3 ;
  29. printf("%f \n" , promedioalumno ) ;
  30.  
  31. if (promedioalumno>=7)
  32. {
  33. printf("aprobado \n") ;
  34. }
  35. else
  36. {
  37. printf("desaprobado \n") ;
  38. }
  39. return 0;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement