C Tutorial
Area of a Sector = (π * radius * radius * central angle)/360
This C program gets radius and central angle as user inputs and computes the area of a sector.
#include<stdio.h> void main() { int radius, central_angle; float area=0; printf("\nFinds Area of a sector\n-------------------"); printf("\nEnter radius: "); scanf("%d", &radius); printf("Enter center angle:"); scanf("%d", ¢ral_angle); area = (3.14*radius*radius*central_angle)/360; printf("Area of Sector: %.2f", area); }Output:
$ cc area-of-sector.c $ ./a.out Finds Area of a sector ------------------- Enter radius: 8 Enter center angle:60 Area of Sector: 33.49
C Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page