0% found this document useful (0 votes)
11 views9 pages

C Applications and Embedded Systems Assessment No. 1

C Applications and Embedded systems Assessment No. 1

Uploaded by

Sahir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views9 pages

C Applications and Embedded Systems Assessment No. 1

C Applications and Embedded systems Assessment No. 1

Uploaded by

Sahir
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Page |1

NG1S901

Introduction to C programming and Embedded Systems

C Applications and Embedded systems

Assessment No. 1

by

[Insert Student’s Name]

[Insert Module Team]

[Insert Submission Date]


Page |2

Task 1: Statistic Calculations

C Code (with comments):


Page |3

Explanation
We have written a C application that allows users to enter a list of numbers and calculate
their average and standard deviation. Average and standard deviation is implemented in the
form of functions. The user starts by entering the number of values and then the application
prompts the sequential entry of these values one by one. The formula for standard deviation


N
1
used is σ = ∑ ( x −μ )2 where N is the number of samples, x i is sample number I, μ is the
N i=1 i
average value.
Screen Printout

Task 2: Matrices Operations

C Code (with comments):


Page |4
Page |5

Explanation
We have written a C application that allows users to perform 2 basic Matrix operations which
are Matrix-Matrix addition function and matrix-matrix multiplication function. The matrix is
represented as 2D arrays. We initially implemented matrices of 2 by 2 elements and then
generalized our functions to handle any n-by-n matrix. We have written code to test our
functions so that the user can choose first the size of matrices, and then enter the values of
each matrix element. The application displays the result of the addition and multiplication of
the two matrices. Moreover, the code is user-friendly and bugs free.
Screen Printout
Page |6

Task 3: I/O

Part 1 C Code (with comments):


Page |7

Explanation
Program developed in Part 1 is enhanced by allowing the user to save average and standard
deviation results in a file that can be opened by a text editor like notepad.
Screen Printout

Part 1 C Code (with comments):


Page |8
Page |9

Explanation
Program developed in Part 2 is enhanced by allowing the user to save matrix addition and
multiplication results in a file that can be opened by a text editor like notepad.
Screen Printout

You might also like