Ask your own question, for FREE!
Computer Science 25 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!
Latest Questions
EdwinJsHispanic: part 2 of singing ;-;
2 hours ago 6 Replies 0 Medals
EdwinJsHispanic: rate my singing, rn I'm a bit sick
2 hours ago 38 Replies 4 Medals
Arriyanalol: what's a non fiction book
2 hours ago 9 Replies 1 Medal
Arriyanalol: what is 67
8 hours ago 3 Replies 1 Medal
Arriyanalol: how did Charlie Kirk die
11 hours ago 2 Replies 1 Medal
Arriyanalol: is these correct
12 hours ago 7 Replies 0 Medals
gelphielvr: Is it possible to read a 400 page verse book in 1 hour?
11 hours ago 31 Replies 3 Medals
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!