To calculate the area of a triangle you need
Your structure would include (at a minimum) the coordinates of the points, eg:
struct triangle
{
int xa, ya;
int xb, yb;
int xc, yc;
};
then you would declare a structure to hold the points and use it to calculate the area, eg:
struct triangle t1;
t1.xa = 0; t1.ya = 0;
t1.xb = 5; t1.yb = 5;
t1,xc = 7; t1.yc = 7;
area = calculate_area(&t1);
To calculate the area, you could put it into a function:
struct triangle *tru;
{
area = (
return area;
}
I'll let you think about:
and put the program together.
Exactly what data you want to store in the struct (minimum the points, but you may want to store the area of the triangle as well - in future you could expand to include calculating the side lengths and angles)
a circle has an area of 36pie square centimeters what is the circumference ?
yes
There is actually no limit to the number of numbers in Pascal's Triangle. The triangle is simply a way to remember the coefficients of the product of two binomials (or the expansion of a binomial raised to a power). See the link below. The triangle starts like this: 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 It goes on forever. Simply begin and end each row with a one and find the numbers in the middle by adding the two above it. Edit: I don't know how to make the above triangle look correct here. The program wants to remove all of the spaces, making the triangle look like a right triangle. Just ignore that. It should look like a pyramid, with the top 1 in the center.
#include<stdio.h> #include<math.h> main() { float A,a,b,c,s; printf("entr the value of a,b and c"); scanf("%f %f %f",&a,&b,&c); A=sqrt(s*s-a*s-b*s-c) printf("area of the triangle %f\n"A); getch(); }
let s1,s2,s3 be three sides of a triangle.import java.lang.*;import java.io.*;import java.util.*;class Triangle{public static void main(String args[]){boolean test=false;int s1,s2,s3;Scanner input = new Scanner(System.in);System.out.println("enter the side1 of triangle");s1=input.nextInt();System.out.println("enter the side2 of triangle");s2=input.nextInt();System.out.println("enter the side3 of triangle");s3=input.nextInt();if((s1*s1)==(s2*s2)+(s3*s3)){test=true;}else if((s2*s2)==(s1*s1)+(s3*s3)){test=true;}else if((s3*s3)==(s1*s1)+(s2*s2)){test=true;}if(test==true)System.out.println("Entered sides form a right angle triangle.....");elseSystem.out.println("Entered sides dosn't form a right angle triangle.....");}}
Write a program that calculates the area of a triangle in QBASIC
program calculates
Reference:cprogramming-bd.com/c_page3.aspx#calculates the value of money
Using while loop, write a program which calculates the product of digits from 1 to 5 and also show these no's vertically.
rapid
No, as long as it calculates something, displays something, or otherwise has an output that benefits the user, it is a program. It could be a program that makes a random number, or a program that tells the user a joke from a database.
An operating system coordinates the activities of computer hardware
Operating system
yea
Functional OPR
ring me and ill explain - 086 22222222222222227 ring me
a circle has an area of 36pie square centimeters what is the circumference ?