Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

Let’s code a circle calculator program with C ⚪

15.4K views on YouTube

#coding #programming #cprogramming

This is a beginner’s practice project to help you get used to math functions

double radius = 0.0;
double area = 0.0;
double surfaceArea = 0.0;
double volume = 0.0;
const double PI = 3.14159;

printf(“Enter the radius: “);
scanf(“%lf”, &radius);

area = PI * pow(radius, 2);
surfaceArea = 4 * PI * pow(radius, 2);
volume = (4.0 / 3.0) * PI * pow(radius, 3);

printf(“Area: %.2lf\n”, area);
printf(“Surface Area: %.2lf\n”, surfaceArea);
printf(“Volume: %.2lf\n”, volume);