Assignment 1 of CIS Resubmit
Assignment 1 of CIS Resubmit
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;
}