Question: Q 2 . ( a ) Write a C program to print a list of all integers between 1 and 9 0 0 ( inclusive

Q2.(a) Write a C program to print a list of all integers between 1 and 900(inclusive) which are divisible by 13 but not by 11. The list should be printed to a file called output.dat. Remember to close the file after use. (35%)(b) Explain the concept of a structure in C. Show how a structured data type may be used to represent a complex number. Based on this structured data type, write a function called multiply which accepts two complex numbers as arguments, and returns their product (note that the output is also a complex number).(30%)(c) Write a function in C to calculate the Euclidean distance between two vectors (of the same length). The function prototype should be: float Euclidean_distance(float *v1, float *v2, int length); Note that the Euclidean distance between two vectors () u u u un ,,,,123 and () n v ,v ,v ,,v 123 of length n is given by 2222211()()() n n d = u v + u v ++ u v .

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!