int main0 1 printr%d %duo\", ++x*y, x*y++); print\"hello: It world la\") print\"
ID: 3726282 • Letter: I
Question
int main0 1 printr%d %duo", ++x*y, x*y++); print"hello: It world la") print"t how are you 1?"); return 0; ) d int sum -65 double average 12.368 char ch b; printSum and Average a la"); printf( 45d %0.2fu", sum, average); print-Character is %d t Sum is %cin',, ch, sum); printr%7.2f is the average, a", average); printr%-8d is the sum 'n'", sum); printf-Character is giit Sum is %i le", ch, sum); Linear modeling problem: 14 points) Suppose you have the data: F. RA Compute the linear model y-mx+b where m and b need to be found out from Equation 3.1 and Equation 3.2 on Page 133 of book by Etter 24Explanation / Answer
The print statement;
printf("%5d %0.2f ",sum,average);
prints the sum as decimal integer with 5 digits, where a maximum of 5 blanks are printed followed by the number; and the average is printed with 2 decimal places.
So the output becomes:
65 12.37.
Next the print statement:
printf("Character is %d Sum is %c ",ch,sum);
this prints ch as a decimal and sum as a character, the output of this line is:
Character is 8 Sum is A.
Next the statement:
printf("%7.2f is average ",average);
prints average as floating point number with 7 places before the decimal point and 2 places after the decimal point, the line prints;
12.37 is average.
Next the statement:
printf("%-8d is the sum ",sum);
prints sum as decimal number with 8 places, in this case the number is printed first and then spaces are added to make the number 8 characters; the line prints;
65 is the sum.
The final statement:
printf("Character is %i Sum is %i ",ch,sum);
prints both sum and character as integers; the line prints;
Character is 8 Sum is 65.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.