luc061.c ​
Metadata ​
- Author — Amit Dutta
- Last updated — 08 Feb 2026
- License — MIT License (See the LICENSE file for details)
Problem Statement ​
Problem Statement
The area of a triangle can be computed by the sine law. Given 6 triangular pieces of land (a, b, angle), find their area and determine which is largest.
Source Code ​
Printing the code
To print this file, open it on GitHub and click Raw before printing, or use the Download Raw button above and print directly from that page.
c
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
int main()
{
// Data arrays
double a[] = {137.4, 155.2, 149.3, 160.0, 155.6, 149.7};
double b[] = {80.9, 92.62, 97.93, 100.25, 68.95, 120.0};
double angle[] = {0.78, 0.89, 1.35, 9.00, 1.25, 1.75}; // Assuming radians based on values < 2.0. 9.00 is treated as literal.
double area, max_area = 0.0;
int i, max_index = -1;
printf("Plot No.\tArea\n");
printf("------------------------\n");
for (i = 0; i < 6; i++)
{
// Area = 1/2 * a * b * sin(angle)
area = 0.5 * a[i] * b[i] * sin(angle[i]);
printf("%d\t\t%.2f\n", i + 1, area);
if (area > max_area)
{
max_area = area;
max_index = i + 1;
}
}
printf("\nLargest Plot is No. %d with Area: %.2f\n", max_index, max_area);
return 0;
}1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35