Txerrinko

Media de números

Jul 26th, 2011
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.   float a , b , c ,x;
  7.  
  8.   fflush(stdin);
  9.   printf("Introduce el primer numero \n");
  10.   scanf("%f",&a);
  11.  
  12.   fflush(stdin);
  13.   printf("Introduce el segundo numero \n");
  14.   scanf("%f",&b);
  15.  
  16.   fflush(stdin);
  17.   printf("Introduce el tercer numero \n");
  18.   scanf("%f",&c);
  19.  
  20.   x=(a+b+c)/3;
  21.   printf("La media es %.3f \n" , x);
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.   system("PAUSE"); 
  30.   return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment