Need Help In C task
Please make sure it is pep9 language not an assembly.
I will attached 2 forms to this assignment which both are examples. The file " Q27 Swap Numbers Source.PDF" is exactly the same program without function. This assignment asking to convert the C program into pep 9 which operate with 3 functions.
getList - putList- Rotate
the second PDF attached is an example of similar program without rotate function. I attached this as a reference to ease your job.
here is the C code that needs to be converted to PEP9
#include
void getList(int ls[], int *n) {
int j;
scanf("%d", n);
for (j = 0; j < *n; j++) {
scanf("%d", &ls[j]);
}
}
void putList(int ls[], int n) {
int j;
for (j = 0; j < n; j++) {
printf("%d ", ls[j]);
}
printf("\n");
}
void rotate(int ls[], int n) {
int j;
int temp;
temp = ls[0];
for (j = 0; j < n - 1; j++) {
ls[j] = ls[j + 1];
}
ls[n - 1] = temp;
}
int main() {
int list[16];
int numItems;
getList(list, &numItems);
putList(list, numItems);
rotate(list, numItems);
putList(list, numItems);
return 0;
}
Sample Input
8
11 22 33 44 55 66 77 88 99
Sample Output
11 22 33 44 55 66 77 88
22 33 44 55 11 66 77 99
7 years ago 4
- Discussion
- Assignment 3: Diagnostic Case Reports
- DONE
- Citing Sources of Information
- ENG 225: Introduction to Film -WK 5 Dis 2
- 2-3 page research paper
- describe how perfomance would be adpted in a housekeeping department if placed in a 5 star, small bed &breakfast concern...
- Respond to 2 of my peers' post by 11:59 PM (eastern time). 200 for each post.
- 16-U6D2 - Assessment & Benchmarking of Collaboration Projecrts - What steps to take, ect.?
- Can anyone do this for me for $40.00 It is due tomorrow, Tuesday, September 13th by 3 p.m. EST