BSC - I - PART A - LAB 1. Write a C Program to read radius of a circle and to find area and circumference

 

1. Write a C Program to read radius of a circle and to find area and circumference




SOURCE CODE : 

#include <stdio.h>

int main() {
    float radius, area, circumference;
    printf("Enter the radius of the circle: ");
    scanf("%f", &radius);
    area = 3.14159 * radius * radius;
    circumference = 2 * 3.14159 * radius;
    printf("Area of the circle: %.2f\n", area);
    printf("Circumference of the circle: %.2f\n", circumference);
    return 0;
}


OUTPUT : 













Post a Comment

0 Comments