1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Ronch [10]
3 years ago
7

Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output tho

se four values on a single line separated by a space. Enter integer: 99 Enter double: 3.77 Enter character: z Enter string: Howdy 99 3.77 z Howdy Extend to also output in reverse. (Submit for 1 point, so 3 points total). Enter integer 99 Enter double: 3.77 Enter character: z Enter string: Howdy 99 3.77 z Howdy Howdy z 3.77 99 Extend to cast the double to an integer, and output that integer Enter integer: 99 Enter double: 3.77 Enter character: z Enter string: Howdy 99 3.77 z Howdy Howdy z 3.77 99 3.77 cast to an integer is 3

Engineering
1 answer:
Likurg_2 [28]3 years ago
4 0

Answer:

See explanation

Explanation:

//Include the

//required header files.

#include <stdio.h>

//Define the

//main() function.

int main(void) {

//Declare the

//required variables.

char input_char;

int input_int;

double input_double;

char input_string[100];

//Prompt the user

//to enter an integer.

printf("Enter integer: ");

//Read and store

//the integer.

scanf("%d", &input_int);

//Prompt the user

//to enter a double value.

printf("Enter double: ");

//Read and store

//the double value.

scanf("%lf", &input_double);

//Prompt the user

//to enter a character.

printf("Enter character: ");

//Read and store

//the character.

scanf(" %c", &input_char);

//Prompt user to

//enter the string

printf("Enter string: ");

//Read and

//store the string.

scanf("%s", input_string);

//(1)

//Display the values.

printf("%d %lf %c %s\n",

input_int, input_double,

input_char, input_string);

//(2)

//Display the values

//in reverse order.

printf("%s %c %lf %d\n",

input_string, input_char,

input_double, input_int);

//(3)

//Cast the double to

//an integer and display it.

printf("%lf cast to an integer is %d",

input_double, (int)(input_double));

//Return from the

//main() function.

return 0;

}

You might be interested in
In this exercise, you will write a Point structure that represents a space in two-dimensional space. This Point should have both
Afina-wow [57]

Answer:

Check the explanation

Explanation:

Points to consider:

We need to take the input from the user

We need to find the manhatan distance and euclidian using the formula

(x1, y1) and (x2, y2) are the two points

Manhattan:

|x_1 - x_2| + |y_1 - y_2|

Euclidian Distance:

\sqrt{(x1 - yl)^2 + (x2 - y2)^2)}

Code

#include<stdio.h>

#include<math.h>

struct Point{

  int x, y;

};

int manhattan(Point A, Point B){

  return abs(A.x - B.x) + abs(A.y- B.y);

}

float euclidean(Point A, Point B){

  return sqrt(pow(A.x - B.x, 2) + pow(A.y - B.y, 2));

}

int main(){

  struct Point A, B;

  printf("Enter x and Y for first point: ");

  int x, y;

  scanf("%d%d", &x, &y);

  A.x = x;

  A.y = y;

  printf("Enter x and Y for second point: ");

  scanf("%d%d", &x, &y);

  B.x = x;

  B.y = y;

  printf("Manhattan Distance: %d\n", manhattan(A, B));

  printf("Euclidian Distance: %f\n", euclidean(A, B));

 

}

Sample output

8 0
3 years ago
Five kilograms of air at 427°C and 600 kPa are contained in a piston–cylinder device. The air expands adiabatically until the pr
son4ous [18]

Answer:

The entropy change of the air is 0.240kJ/kgK

Explanation:

T_{1} =427+273K,T_{1} =700K\\P_{1} =600kPa\\P_{2} =100kPa

T_{2}  is unknown

we can apply the following expression to find T_{2}

-w_{out} =mc_{v} (T_{2} -T_{1} )

T_{2} =T_{1} -\frac{w_{out } }{mc_{v} }

now substitute

T_{2} =700K-\frac{600kJ}{5kg*0.718kJ/kgK} \\T_{2}=533K

To find entropy change of the air we can apply the ideal gas relationship

Δs_{air}=c_{p} ln\frac{T_{2} }{T_{1} } -Rln\frac{P_{2} }{P_{1} }

Δs_{air} =1.005*ln(\frac{533}{700})-0.287* in(\frac{100}{600} )

Δs_{air} =0.240kJ/kgK

4 0
3 years ago
Can some help me with this !!! Is 26 points!!
Aleonysh [2.5K]
Third one
15,000,000 ohms because M=10^6
8 0
3 years ago
What causes a boat to float? My questions are super easy. So you can follow me if you like easy question.
marin [14]
Boats float because the gravity is acting down on it and the buoyant force is acting up on the ship.
6 0
3 years ago
Read 2 more answers
Which sentence best describes the entire Energy career cluster? O Energy careers involve the generation, transmission, and distr
nadezda [96]

Answer:

B

Explanation:

i took the test.

3 0
2 years ago
Read 2 more answers
Other questions:
  • Refrigerant-134a enters a diffuser steadily as saturated vapor at 600 kPa with a velocity of 160 m/s, and it leaves at 700 kPa a
    10·2 answers
  • Question 5
    7·2 answers
  • State 2 reasons on why blind spot checks are important
    5·1 answer
  • Define Plastic vs elastic deformation.
    13·1 answer
  • According to the video, what are some of the effects of the increase in the use of automated tools for Loading Machine Operators
    10·2 answers
  • 1. Using a typical frequency value for the initiating event and PFD values provided in class lectures, estimate the mishap or co
    6·1 answer
  • Should you ever grab a tool with expose wiring
    13·2 answers
  • Ask a question about your assignment
    8·2 answers
  • 1. If a Gear with a 3 inch Diameter is being turned by a Gear with a 6 inch Diameter, which Gear will rotate at a higher Rate?
    12·1 answer
  • Given the inherent costs of regulation it is safe to say that there is always a negative economic impact associated with regulat
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!