Question: LAB ACTIVITY 2 . 2 5 . 1 : LAB: Warm up: Variables, input, and casting 0 5 main.c Load default template... 1 #include stdio

LAB
ACTIVITY
2.25.1: LAB: Warm up: Variables, input, and casting
05
main.c
Load default template...
1 #include stdio.h>
int main(void){
int userInt;
double userDouble;
// FIXME: Define char and string variables similarly
printf("Enter integer: ??
");
scanf("%d", &userInt);
// FIXME (1): Finish reading other items into variables, then output the four values on a single line separated by
// FIXME (2): Output the four values in reverse
// FIXME (3): Cast the double to an integer, and output that integer
return ;
[}]
(1) 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 (2 pts)
Note: This zyLab outputs a newline after each user-mput prompt. For convenience in the examples below, the user's input value is shown on the next line, but such values don't actually appear as output when the program runs.
Enter integer:
99
Enter double:
3.77
Enter character:
z
Enter string:
Howdy
993.770000 z Howdy
(2) Extend to also output in reverse (1pt)
Enter integer:
99
Enter double:
3.77
Enter character:
z
Enter string:
Howdy
993.770000 z Howdy
Howdy z 3.77000099
(3) Extend to cast the double to an integer, and output that integer. (2 pts)
Enter integer:
99
Enter double:
3.77
Enter character:
z
Enter string:
Howdy
993.770000 z Howdy
Howdy z,3.77000099
3.770000 cast to an integer is 3
5220883004346.9x3+09y7
 LAB ACTIVITY 2.25.1: LAB: Warm up: Variables, input, and casting 05

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!