Question

Write a C program to find area of triangle (At) and find value of z , z=x +Vx2 + 2x. Note: Area of triangle(At)=0.5*(b*h).
1 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>

#include <math.h>

int main() {

double b = 5, h = 10, x = 3;

printf("b is: %lf\n", b);

printf("h is: %lf\n", h);

printf("x is: %lf\n", x);

printf("Area is: %lf\n", 0.5*b*h);

double z = x*x*x + sqrt(x*x + 2*x);

printf("z is: %lf ", z);

return 0;

}

==================================
SEE OUTPUT

Files main.c. saved 1 #include <stdio.h> #include <math.h> main.c 2 3 > clang-7 -pthread - Zm } ./main bis: 5.000000 h is: 10

Thanks, PLEASE COMMENT if there is any concern.

Add a comment
Know the answer?
Add Answer to:
Write a C program to find area of triangle (At) and find value of 'z' ,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Question 4 Write a program that display the area of a triangle. The program calls the...

    Question 4 Write a program that display the area of a triangle. The program calls the following two functions: .getBaseHeight - This function uses a reference parameter variables to accept a double arguments base and height. This function should ask the user to enter the triangle's buse and height. Input validation: base and height should be positive numbers. calArea - This function should accept the triangle's base and height as arguments and return the triangle's area. The area is calculated...

  • #1 Write a java program which calculates the area of either a Triangle or a Rectangle....

    #1 Write a java program which calculates the area of either a Triangle or a Rectangle. Use Scanner to take an input field to tell you if the area to be calculated is for a Triangle or is for a Rectangle. Depending on that input - the program must call either the Triangle method or the Rectangle method. Each of those methods must receive 2 input fields from the user - one for base and one for height in order...

  • 1. Write a C++ program that reads sides of a triangle a, b and c from a file and computes the are...

    1. Write a C++ program that reads sides of a triangle a, b and c from a file and computes the area of a triangle and counts total number of areas program has computed Program should have two functions sfun(): sfun receives the values of a, b and c then computes and returns the value ofs as areafun 0: areafun receives the value of s and computes and return the area of a triangle to main program using below formulae...

  • Write a program to compute the area of a triangle using side-angle-side method and reports the...

    Write a program to compute the area of a triangle using side-angle-side method and reports the area of that triangle (rounded to 2 decimal places). Side-angle-side formula: ???? = 1/ 2 ?? sin(?), where a and b are two sides of the triangle, and C is the included angle. Your program must meet the following criteria to receive full marks: • Randomly generate two values between 5 and 10 (inclusive) for two sides a and b of the triangle, respectively....

  • Write a program using the class to find out the area of a circle and volume...

    Write a program using the class to find out the area of a circle and volume of a cylinder. [* area of a circle=πr2, the volume of a cylinder=πr2*h where h is the height of the cylinder and r is the radius of the circular end of the cylinder] 1. The member variable should be private 2. Use public member functions to execute your program. 3. Use set ( ) function to access the private members 4. Use another approach...

  • Modify the program of Project 4 to compute the area of a triangle. Issue the appropriate...

    Modify the program of Project 4 to compute the area of a triangle. Issue the appropriate prompts for the triangle’s base and height, and change the names of the variables appropriately. Then, use the formula .5 * base * height to compute the area. Test the program from an IDLE window.

  • use matlab and show all codes and work the question continues from this 4. Write a...

    use matlab and show all codes and work the question continues from this 4. Write a function with header (A, V - myCone (r, h), which outputs the total area A and volume of a cone with base radius r and height h. 5. Write a function - myMatrix (myvec, m, n) which creates an m-by-n matrix A, as in Problem 3, but for arbitrary values of mand n and any length of vector myvec. Hint: the function can use...

  • C++ programming For this assignment, write a program that will act as a geometry calculator. The...

    C++ programming For this assignment, write a program that will act as a geometry calculator. The program will be menu-driven and should continue to execute as long as the user wants to continue. Basic Program Logic The program should start by displaying a menu similar to the following: Geometry Calculator 1. Calculate the area of a circle 2. Calculate the area of a triangle 3. Quit Enter your choice(1-3): and get the user's choice as an integer. After the choice...

  • I need to write a class in C++. I need to make a class that uses...

    I need to write a class in C++. I need to make a class that uses measurements of a triangle and outputs its area. It needs to have the following things. variables the hold the base and height, and those should be doubles for precision. Member functions to get and set the variables from part one and that check to ensure the values entered are greater than zero. If the values are incorrect, the function must prompt the user for...

  • 1. Write a program that determines the area and perimeter of a square. Your program should...

    1. Write a program that determines the area and perimeter of a square. Your program should accept the appropriate measurement of the square as input from the user and display the result to the screen. Area of Square = L (squared) Perimeter of Square = 4 * L 2.  Write a program that determines the area and circumference of a circle. Your program should accept the appropriate measurement of the circle as input from the user and display the result to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT