0% found this document useful (0 votes)
25 views

Assignment 1 of CIS Resubmit

The document contains the name, ID number, intake, and section of the student Md Hasibur Rahman. It then provides the code for calculating the areas of different shapes - a sphere, rectangle, trapezium, square, and circle. Each code snippet includes the relevant header files, inputs the values, calculates the area formula, and prints the output.

Uploaded by

hasibherok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Assignment 1 of CIS Resubmit

The document contains the name, ID number, intake, and section of the student Md Hasibur Rahman. It then provides the code for calculating the areas of different shapes - a sphere, rectangle, trapezium, square, and circle. Each code snippet includes the relevant header files, inputs the values, calculates the area formula, and prints the output.

Uploaded by

hasibherok
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Assignment 1

Name : Md Hasibur Rahman

Id : 19202101211

Intake : 51

Section: 5

C Programs

 Area of Spherer
#include<stdio.h>
#define PI 3.14159
#include<math.h>
#include<stdlib.h>
int main()
{

float radious,area;
printf("Enter radious of the sphere: ");
scanf("%f", &radious);
area = (4 * PI* radious *radious);
printf("Area of the sphere = %.2f", area);

return 0;
}

 Area of rectangle
#include<stdio.h>

int main()
{
float lenght,width, area;
printf("Enter lenght of the rectangle: ");
scanf("%f", &lenght);
printf("Enter width of the rectangle: ");
scanf("%f", &width);
area = ( lenght*width );
printf("Area of the rectangle = %.2f", area);

return 0;
}
 Area of area of a area trapezium
#include<stdio.h>

int main()
{
float base, base2, height, area;
printf("Enter base of the trapezium: ");
scanf("%f", &base);
printf("Enter base2 of the trapezium: ");
scanf("%f", &base2);
printf("Enter height of the trapezium: ");
scanf("%f", &height);
area =(base + base2)/ 2.0 * height;
printf("Area of the trapezium = %.2f", area);

return 0;

Area of squre
#include<stdio.h>

int main()
{
float base, area;
printf("Enter base of the squre: ");
scanf("%f", &base);
area =(base * base);
printf("Area of the squre= %.2f", area);

return 0;

}
Area of a circle
#include<stdio.h>
#define PI 3.14159
#include<math.h>
#include<stdlib.h>
int main()
{

float radious,area;
printf("Enter radious of the circle: ");
scanf("%f", &radious);
area = ( PI* radious *radious);
printf("Area of the sphere = %.2f", area);

return 0;
}

You might also like