fork download
  1. #include <iostream>
  2. using namespace std ;
  3.  
  4.  
  5.  
  6.  
  7. void print() {
  8. cout << "enter the length " << endl ;
  9. }
  10.  
  11. double getlength() {
  12. print() ;
  13. double l ;
  14. cin >> l ;
  15. return l ;
  16. }
  17. void print2() {
  18. cout << "your Area = " ;
  19. }
  20.  
  21. double S_Area(double l) {
  22. double area = l*l ;
  23. print2() ;
  24. return area ;
  25. }
  26.  
  27.  
  28.  
  29. int main () {
  30.  
  31. double length = getlength() ;
  32. cout << S_Area(length) ;
  33.  
  34. return 0 ;
  35. }
Success #stdin #stdout 0s 5320KB
stdin
3
stdout
enter the length 
your Area = 9