English

Implement a circle class. Each object of this class will represent a circle accepting its radius value as of float. Evaluate an area() function which will calculate the area of circle. - Computer Science 1

Advertisements
Advertisements

Question

Implement a circle class. Each object of this class will represent a circle accepting its radius value as of float. Evaluate an area() function which will calculate the area of circle.

Code Writing
Advertisements

Solution

#include <iostream.h>
class Circle
{
    private :
      float a ;
      float r ; 
    public:
      Void area (void);
      };
      void ara (void);
      }
         count<<"Enter redius of circle"; cin>>r,
      a : 3.14 * r * r ;
      count<<\n The area of circle is"<<a; }
    main()
    {
      circle c;
      c. area();
     return(0);
     }
shaalaa.com
  Is there an error in this question or solution?
2024-2025 (July) Official Board Paper
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×