bsc

Comprehensive codebase and cou...
Log | Files | Refs | README | LICENSE

assignment-s-11.c (822B)


      1 /*
      2  * Author: Amit Dutta (amitdutta4255@gmail.com) | Date: 17 Dec 2025
      3  * Repo: https://github.com/notamitgamer/bsc
      4  * License: MIT
      5  */
      6 
      7 /* Write a program that takes the radius of a circle as input, passes it to a function that
      8 computes area and circumference, and displays results in main(). */
      9 
     10 #include <stdio.h>
     11 #include <math.h>
     12 
     13 void area_circumference(double, double *, double *);
     14 
     15 int main()
     16 {
     17     double r, area, circumference;
     18     printf("Enter the radius of the circle: ");
     19     scanf("%lf", &r);
     20     area_circumference(r, &area, &circumference);
     21     printf("\nArea of the circle = %g", area);
     22     printf("\nCircumference of the circle = %g", circumference);
     23     return 0;
     24 }
     25 
     26 void area_circumference(double r, double *area, double *circumference)
     27 {
     28     *area = M_PI * r * r;
     29     *circumference = 2 * M_PI * r;
     30 }
© notamitgamer • Site Built: 2026-07-21 13:58:23 UTC • git-mirror commit: 1037f62 [view raw info]
Originally created with stagit • modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror