fork download
  1. #include <stdio.h>
  2.  
  3. void rectangle(double height, double width)
  4. {
  5. printf("\nArea:\t\t%lf", height*width);
  6. printf("\nPerimeter:\t%lf", 2*(height+width));
  7. }
  8. int main()
  9. {
  10. double height, width;
  11. printf("Enter height and width of rectangle:\t");
  12. scanf("%lf%lf", &height, &width);
  13.  
  14. rectangle(height, width);
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 1680KB
stdin
5 25
stdout
Enter height and width of rectangle:	
Area:		125.000000
Perimeter:	60.000000