2. (B) Write a program to find the area of rectangle, square and circle.
Area of Circle:
| ||
| float radius, area; | ||
| printf("\nEnter the radius of Circle : "); | ||
| scanf("%d", &radius); | ||
| area = 3.14 * radius * radius; | ||
| printf("\nArea of Circle : %f", area); | ||
| return (0); | ||
| } |
Area of Square:
| #include<stdio.h> |
| int main() { | |
| int side, area; | |
| printf("\nEnter the Length of Side : "); | |
| scanf("%d", &side); | |
| area = side * side; | |
| printf("\nArea of Square : %d", area); | |
| return (0); | |
| } |
Area of Rectangle:
| #include<stdio.h> | |
| #include<conio.h> | |
| int main() { | |
| int length, breadth, area; | |
| printf("\nEnter the Length of Rectangle : "); | |
| scanf("%d", &length); | |
| printf("\nEnter the Breadth of Rectangle : "); | |
| scanf("%d", &breadth); | |
| area = length * breadth; | |
| printf("\nArea of Rectangle : %d", area); | |
| return (0); | |
| } |
2. (B) Write a program to find the area of rectangle, square and circle.
Reviewed by admin
on
December 23, 2019
Rating:
Reviewed by admin
on
December 23, 2019
Rating:

No comments: