1. Question:C program for area of equilateral triangle 

    Answer
    #include<stdio.h>
    #include<math.h>
    
    int main(){
    
        float a;
        float area;
    
        printf("Enter size of side of the equilateral triangle : ");
        scanf("%f",&a);
    
        area = sqrt(3)/4*(a*a);
    
        printf("Area of equilateral triangle is: %.3f",area);
    
        return 0;
    }
    Sample output: Enter size of side of the equilateral triangle: 5 Area of equilateral triangle is: 10.825






    1. Report
  2. Question:C program for area of right angled triangle 

    Answer
    #include<stdio.h>
    int main(){
        float h,w;
        float area;
    
        printf("Enter height and width of the right angled triangle : ");
        scanf("%f%f",&h,&w);
    
        area = 0.5 * h * w;
        printf("Area of right angled triangle is: %.3f",area);
        return 0;
    }
    Sample output: Enter height and width of the right angled triangle: 10 5 Area of right angled triangle is: 25.000






    1. Report
  3. Question:C program for area of a rectangle 

    Answer
    #include<stdio.h>
    
    int main(){
    
        float l,w;
        float area;
    
        printf("Enter size of each sides of the rectangle : ");
        scanf("%f%f",&l,&w);
    
        area = l * w;
        printf("Area of rectangle is: %.3f",area);
    
        return 0;
    }
    [b]Sample output:[b] Enter size of each sides of the rectangle: 5.2 20 Area of rectangle is: 104.000






    1. Report
  4. Question:C program for area of a trapezium 

    Answer
    #include<stdio.h>
    
    int main(){
    
        float b1,b2,h;
        float area;
    
        printf("Enter the size of two bases and height of the trapezium : ");
        scanf("%f%f%f",&b1,&b2,&h);
    
        area = 0.5 * ( b1 + b2 ) * h ;
        printf("Area of trapezium is: %.3f",area);
        return 0;
    }
    Sample output: Enter the size of two bases and height of the trapezium: 5 8 3 Area of trapezium is: 19.500






    1. Report
  5. Question:C program for area of a cube 

    Answer
    #include<stdio.h>
    
    int main(){
    
        float a;
        float surface_area,volume;
    
        printf("Enter size of any side of a cube : ");
        scanf("%f",&a);
    
        surface_area = 6 * (a * a);
        volume = a * a * a;
    
        printf("Surface area of cube is: %.3f",surface_area);
        printf("\nVolume of cube is : %.3f",volume);
    
        return 0;
    }
    Sample output: Enter size of any side of a cube: 3 Surface area of cube is: 54.000 Volume of cube is: 27.000






    1. Report
Copyright © 2025. Powered by Intellect Software Ltd