Concept explainers
Write a
( – –) – –)
Explanation of Solution
Program:
The following program will evaluate the given expression.
//include the header file
#include <stdio.h>
//definition of main method
int main (void)
{
//declare the variable
float ans;
//calculate the ans
ans = (3.31e-8f * 2.01e-7f) / (7.16e-6f + 2.01e-8f);
//display the result
printf ("The answer is %e\n", ans);
//return statement
return 0;
}
Explanation:
In the above program, declare the required header file. Inside the main method, declare the variable. Then calculate the “ans” value and print the result on the output screen.
The answer is 9.266027e-10
Want to see more full solutions like this?
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Objects (6th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with C++: Early Objects
Starting Out With Visual Basic (7th Edition)
- Write a program using nested loop structures that displays the following output. Please answer using java nested loopsarrow_forwardWhat is the output from each of the following pseudocode statements?arrow_forwardThe correct declaration statement is: int X; Y; int X, Y; int X, Y int X, Y,arrow_forward
- Compute the volume of a cylinder) Write a program that reads in the radius and length of a cylinder and computes the area and volume using the following formulas: area = radius * radius * p volume = area * lengtharrow_forwardShow the value of x after each of the following statements is performed:a) x = fabs(7.5);b) x = floor(7.5);c) x = fabs(0.0);d) x = ceil(0.0);e) x = fabs(-6.4);f) x = ceil(-6.4);g) x = ceil(-fabs(-8 + floor(-5.5)));arrow_forwardHi, thank you for your solution. When I try to run the program it gives me the following error:arrow_forward
- Write out a truth table (including all four cases) for the following expressions. Here, p,q and r represent simple statements that can be true or false. a) ~p . q . ~rarrow_forwardC++ Programming Exercise: A real estate office handles, say, 50 apartment units. When the rent is, say, $600 per month, all the units are occupied. However, for each, say, $40 increase in rent, one unit becomes vacant. Moreover, each occupied unit requires an average of $27 per month for maintenance. How many units should be rented to maximize the profit? Write a program that prompts the user to enter: a. The total number of of units. b. The rent to occupy all the units. c. The increase in rent that results in a vacant unit. d. Amount to maintain a rented unit. The program then outputs the number of units to be rented to maximize the profit.arrow_forwardWrite a program that does the following:arrow_forward
- Write a code and draw a flowchart for the following question. Take a number N and print the following output matrix pattern according to the given N. Focus on the pattern. For Example ifarrow_forward3. Write Python expressions or assignments as specified:a. Assign x to be 5, y to be 10, and z to be 8.b. Write an expression that evaluates to the average of x, y and z.c. Write an expression that evaluates to the largest value among x, y, and z.d. Write an expression that evaluates to the median value among x, y, and z (Hint:the median of a, b, and c is a+b+c - max{a,b,c} - min{a,b,c}.)arrow_forwardWrite a program that displays the following checkerboard pattern.Your program must use only three output statements, one of each of the following forms:cout << " * ";cout << ' ';cout << endl;arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning