0 votes
95 views
in Programming by (98.9k points)
edited by
Write a c++ function to find surface area of sphere?

1 Answer

0 votes
by (98.9k points)
edited
#include <stdio.h>
#include <math.h>
 
int main()
{
 
 float radius;
 float surface_area, volume;
 
 printf("Enter radius of the sphere : \n");
 scanf("%f", &radius);
 surface_area = 4 * (22/7) * radius * radius;
 volume = (4.0/3) * (22/7) * radius * radius * radius;
 printf("Surface area of sphere is: %.3f", surface_area);
 printf("\n Volume of sphere is : %.3f", volume);
 return 0;
}

Related questions

0 votes
1 answer 159 views
asked Apr 24, 2022 in Programming by Doubtly (98.9k points)
0 votes
1 answer 148 views
+1 vote
1 answer 246 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

550 users

...