Ask your own question, for FREE!
Computer Science 57 Online
MARC:

Double check my coding answer

MARC:

http://prntscr.com/ltzkxb

MARC:

#include <stdio.h> float calarea(float,float); void calperimeter(float *, float, float); void display(float, float); float perimeter1,perimeter2; int main() { float area1,area2; area1=calarea(2.5,3.5); area2=calarea(1.5,5.5); calperimeter(&perimeter1,2.5,3.5); calperimeter(&perimeter2,1.5,5.5); display(area1,area2); return 0; } float calarea(float x,float y) { float area; area=x*y; return area; } void calperimeter(float *a,float b,float c) { *a=2*(b+c); return ; } void display(float i,float j) { printf("\narea = %.2f",i); printf("\nperimeter = %.2f",perimeter1); printf("\narea = %.2f",j); printf("\nperimeter = %.2f",perimeter2); }

JustSaiyan:

@Ultrilliam @dude

imqwerty:

you may directly return x*y in your calarea function

MARC:

umm,wait a minute , how to do that? X'D Can u show me XD

imqwerty:

float calarea(float x,float y) { return x*y; }

MARC:

owh I c,thanks 4 the info ^

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!