![stefancvorovic1](/avatars/19907.jpg)
stefancvorovic1
18.03.2020 •
Engineering
Prompt the user to input an integer, a double, a character, and a string, storing each into separate variables. Then, output those 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
Solved
Show answers
More tips
- F Family and Home How to Raise a Genius? Discover the Secrets Here...
- F Food and Cooking How to Properly Cook Buckwheat?...
- H Health and Medicine How to Tan in a Tanning Bed? Tips and Recommendations...
- S Style and Beauty How to Sew a Balloon Skirt: Detailed Tutorial and Tips on Choosing the Right Fabric...
- P Philosophy Personal attitude towards Confession: how to prepare and undergo the procedure correctly?...
- F Food and Cooking How to Make Cottage Cheese at Home: Simple and Quick Recipe with Step By Step Instructions...
- H Health and Medicine Which Water Are You Drinking? Is it Worth Buying Bottled Water?...
- H Health and Medicine What Makes a Man a Man?...
- H Health and Medicine What to Take with You to the Maternity Hospital?...
- F Food and Cooking What Foods Can Nursing Moms Eat?...
Answers on questions: Engineering
- M Mathematics Quadrilaterals HIJK and ABCD are congruent. The side length of each square on the grid is 1 unit. Which of the following sequences of transformations maps HIJK onto ABCD?...
- E English 15. What should a reporter always make time to do?...
- P Physics Mass of the hanging mass pies Fnet=weight Acceleration...
- B Business KADS, Inc., has spent $390,000 on research to develop a new computer game. The firm is planning to spend $190,000 on a machine to produce the new game. Shipping and installation...
- C Chemistry Select the newman projection that corresponds to the following molecule 2. select the choice that best describes the relationship of the following pair of compounds...
Ответ:
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;
}
Ответ:
————
x+2