代做DTS202TC Foundation of Parallel Computing Lab 3: C Programming Basics代做Statistics统计
- 首页 >> C/C++编程DTS202TC Foundation of Parallel Computing
Lab 3: C Programming Basics
Task 1, Environment Setup
Please follow previous labs to set up your virtual machine and install JetBrains CLion if you haven’t already done so. Once your environment is ready, proceed with the tasks below. Avoid using AI assistance.
Task 2
Write the following function:
double inner_product(double a[], double b[], int n);
The function should return a[0] * b[0] + a[1] * b[1] + ... + a[n-1] * b[n-1].
Task 3
Rewrite Task 2 using pointer.
Task 4
Write a C program to count the number of characters and words in a file in CLion. Upload code to virtual machine. The program should be able to compiled and run by:
1. make
2. ./wc path_to_text.txt
Task 5 (optional)
Ask AI for more practices if you finished early.
