{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Discussion Notes 5

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

This preview shows pages 1–6. Sign up to view the full content.

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

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

View Full Document
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
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; }

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

View Full Document
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
Sort Numbers in Ascending Order #include <stdio.h> #define N 5 int main() { int a[N] = {5, 7, 2, 1, 3}; int i, j, temp;

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 13

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

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

View Full Document
Ask a homework question - tutors are online