Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- #include <math.h>
- int calculate(double a,double b, double c, double* p, double* s){
- *p = a+b+c;
- *s = sqrt(*p/2 *(*p/2 -a)*(*p/2 -b)*(*p/2 - c));
- return 0;
- }
- int main(){
- double a = 20;
- double b = 10;
- double c = 10;
- double p = 0.0;
- double s = 0.0;
- calculate(a,b,c,&p,&s);
- printf("%lf",p);
- printf("%lf",s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement