- Get link
- X
- Other Apps
Diagonal of a rectangle:-
Use pow() and sqrt() to implement the above formula d = √( l2 + w2).
The program:
- #include<stdio.h>
- #include<math.h>
- void main()
- {
- float d,w=20,h=10;
- d = sqrt(pow(w,2)+pow(h,2));
- printf("Result Value = %f",d);
- }
Result Value = 22.360680
Comments
Post a Comment