Home / Expert Answers / Computer Science / 1-given-the-following-c-code-design-a-c-program-1-assigning-123-to-a-4-using-only-the-point-pa305

(Solved): 1. Given the following C code, design a C program - (1) assigning 123 to a[4] using only the point ...



1. Given the following \( \mathrm{C} \) code, design a \( \mathrm{C} \) program - (1) assigning 123 to a[4] using only the po

1. Given the following code, design a program - (1) assigning 123 to a[4] using only the pointer , (2) printing a using only the pointer . Do not modify the following code and do not use the array . Test it and take a screenshot showing your code. (4 points) 2. Given the following code, design a program - (1) moving a file pointer using fseek (2) saving this sentence "This is Your Name" to sample.txt using fputs with . Do not modify the following C code. int main ()\{ FILE *fp; fp fopen("sample.txt","w+"); fputs("This is CSIT315", fp); return(0); Save your program to lab5.c, and take a screenshot showing your code and its output. (4 points) 3. Design a shell program (called "auto_compile_run.sh") meeting the following requirements ( 2 points) a. Two file names are given as two arguments of auto_compile_run.sh. For example, auto_compile_run.sh lab5.c lab5 The first argument (lab5.c) is a file, and the second argument is its executable file (lab5). b. If there is no argument, echo "No Input Files". c. In auto_compile_run.sh, the C program must be compiled and run.


We have an Answer from Expert

View Expert Answer

Expert Answer


1) writing the code in c programming:#include int main() { int a[10], *p, *q; p = &a[2]; q = p + 1; *q = 123; // assign 123 to a[4] using
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe