Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c program classroom.google.com 1. (8 pts) Answer true or false and explain why. a. The following declaration of two integers is valid: int myWeight1, MyWeight1;

image text in transcribed
image text in transcribed
c program
classroom.google.com 1. (8 pts) Answer true or false and explain why. a. The following declaration of two integers is valid: int myWeight1, MyWeight1; b. The following declaration of a float variable is valid: float 2nd year; C. The following declaration of a char variable is valid: char re-educated; d. Not indenting the code properly does not lead to compilation errors. 2. (12 pts) What is the output of the following program? #include int main(void) int x = 3, y = 8; x = 2*y; /* 2*y is assigned to variable x */ y = y + 2; /* y + 2 is assigned to y */ x - 2*x + y; /*the current values of x and y are used printf("X - Ad Y = d ", x, y); return 0; 3. (15 pts) Fix each printf statement below so the expected output is printed: //Expected output: +75.602% printf("%+.3f%, 75.6023); //Expected output: He said "Good Day" printf("She said "Nice Job"); //Expected output: % printf(%c, '%'); 4. (10 pts) Give the output of the following statement. If the program outputs any spaces, tell how many. printf("%+017.4E", 12.52); 5. (10 pts) Write calls to printf to display the variable x in the following formats: a. x is a float. Format: Exponential notation, left justified, in field size of 5 with 3 digits after the decimal point b. x is an int. Format: Right justified, in a 9 digit field 6. (15 pts) Assume that a and b are int variables and is a float variable. What is the value of each variable after the following scanf is called? scanf("%d%f%d", &a,&x, &b); supposing the user enters: 9.2 8 13 7. (15 pts) Write a single statement to read the time from the standard input in the form of humus and store it in three integer variables named hours, minutes and seconds. 8. (15 pts) Write a single statement to read a percentage from the standard input. For example, the user enters 13.6% and program stores 13.6 into a float variable named percent. The variable percent has been declared to be float

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions

Question

16.8 Explain the typical steps in a grievance procedure.

Answered: 1 week ago

Question

16.4 Outline the five steps in the labour relations process.

Answered: 1 week ago