Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  m
Language: C/C++
Code:
#include <stdio.h>
int main(){
     int p1=1,p2=1;
     float n1,n2,med;
     
     scanf("%f%f%d%d", &n1, n2, &p1, &p2);
     
     while(p1>=1 && p2>=1){
          med=((n1*p1)+(n2*p2)/(p1+p2));
     }
     printf("%.2f\n", med);
     
     return 0;
}
Comments: