1. Question:C program for area of circle 

    Answer
    #include <stdio.h>
    #define PI 3.141
    int main(){
      float r, a;
      printf("Radius: ");
      scanf("%f", &r);
      a = PI * r * r;
      printf("%f\n", a);
      return 0;
    }






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

    Answer
    #include<stdio.h>
    #include<math.h>
    
    int main(){
       
        float a,b,c;
        float s,area;
       
        printf("Enter size of each sides of triangle");
        scanf("%f%f%f",&a,&b,&c);
       
        s = (a+b+c)/2;
        area = sqrt(s*(s-a)*(s-b)*(s-c));
       
        printf("Area of triangle is: %.3f",area);
       
        return 0;
    }
    Sample output: Enter size of each sides of the triangle: 2 4 5 Area of triangle is: 3.800






    1. Report
  3. 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
  4. 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
  5. 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
Copyright © 2025. Powered by Intellect Software Ltd