Discussion Notes 5

Discussion Notes 5 - EME 5 Discussion 5 Left Justified and...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
EME 5 Discussion 5 Left Justified and Assignment Suppression Character Sort Numbers in Ascending Order Mean Value Plotting in Ch Solve Linear Equations in Ch
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Left Justified and Assignment Suppression Character Write a program to print out left justified numbers. Use 4 spaces to output each number. The user input format is #,#,# (e.g. 1,10,2) 1 st # is the initial number, 2 nd # is the final number, 3 rd # is the incremental value Use assignment suppression character
Background image of page 2
Left Justified and Assignment Suppression Character (contd.) #include <stdio.h> int main() { int initial, final, increment; int i; printf("Enter three numbers: "); scanf("%d%*c%d%*c%d", &initial, &final, &increment); for(i=initial; i<=final; i+=increment) { printf("%-4d|\n", i); } return 0; }
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Sort Numbers in Ascending Order Write a program to sort the following array in ascending order [5, 7, 2, 1, 3] Write a program to find the median of the array
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/21/2008 for the course EME 005 taught by Professor Cheng during the Fall '07 term at UC Davis.

Page1 / 13

Discussion Notes 5 - EME 5 Discussion 5 Left Justified and...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online