SHARE
TWEET

Untitled

a guest Jan 16th, 2019 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. void main(){
  3.     float arr[10];
  4.     float suma=0, media=0;
  5.     int cuantos=0, i=0, aprovados=0, suspensos=0;
  6.     for(i=0;i<10;i++){
  7.         printf("introduce una nota\n");
  8.         scanf("%f", &arr[i]);
  9.         if(arr[i]>=5){
  10.             aprovados=aprovados+1;
  11.         }
  12.         else{
  13.             suspensos=suspensos+1;
  14.         }
  15. }
  16.     for(i=0;i<10;i++){
  17.         suma=suma+arr[i];
  18.         cuantos=cuantos+1;
  19.     }
  20.     media=suma/cuantos;
  21.     printf("La media es %.2f\n", media);
  22.     printf("Hay %d aprovados\n", aprovados);
  23.     printf("Hay %d suspendidos\n", suspensos);
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top