nikolas_serafini

Lista 1 - Exercício 32

May 22nd, 2013
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.37 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main()
  6. {
  7.     float num,num2,med;
  8.     int val,val2;
  9.  
  10.     printf("Entre com os dois valores : \n"); scanf("%f %f",&num,&num2);
  11.     printf("Entre com os pesos para cada valor, respectivamente :\n"); scanf("%d %d",&val,&val2);
  12.     med = (val*num + val2*num2)/2;
  13.     printf("Media ponderada = %f\n",med);
  14.     return 0;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment