Respuesta :
Answer:
#include <stdio.h>
int main()
{
int userInt;
double userDouble;
char userChar;
char userString[50];
printf("Enter integer: \n");
scanf("%d", &userInt);
printf("Enter double: \n");
scanf("%lf", &userDouble);
printf("Enter character: \n");
scanf(" %c", &userChar);
printf("Enter string: \n");
scanf("%s", userString);
printf("%d %lf %c %s \n", userInt, userDouble, userChar, userString);
printf("%d %lf %c %s %s %c %lf %d \n", userInt, userDouble, userChar, userString, userString, userChar, userDouble, userInt);
printf("%d %lf %c %s %s %c %lf %d %lf cast to an integer is %d \n", userInt, userDouble, userChar, userString, userString, userChar, userDouble, userInt, userDouble, (int)userDouble);
return 0;
}
Explanation:
In addition to int and double, declare the char and string
In addition to the int, ask the user to enter the double, char and string
Print the variables in the same order as they entered
In addition to entered order, also print the variables in reverse order - type the variables in reverse order
In addition to reverse order, print the casting value of the double as int - to cast a double to an int put (int) before the variable name