CPE 325 Laboratory Assignment #2 Solved

35.00 $

Category:

Description

Rate this product

Assignment

  1. Write a C program that will print the sizes and ranges of common data types char, short int, int, long int, long long int, unsigned char, unsigned short int, unsigned int, unsigned long int, unsigned long long int, float, and double. Your program’s output should be like the following:

———————————————————————–

| Data Type      | Size (in bytes)  | Minimum         | Maximum       |

———————————————————————–

| char           | 1                | 0               | 255           |

| short int      | 2                | -32768          | 32767         |

|(additional data types goes here) |                  |                 |

———————————————————————–

Note: You should use definitions given in the limits.h and float.h header files for the ranges of data types. For float and double, display positive minimum value in Minimum column.

For unsigned short int and signed int data type, please compute how the respective maximum and minimum values can be found based on their size. Does it match the value that you see in the table above? Take a picture of your solution and paste it in your report document. Alternately, you can solve in word document which can be added to the submission report.

  1. Write a C program that declares and initialized an integer array x. x should have at least 5 elements. Declare and initialize two additional integer variables m and c. You are required to compute another integer array y such that each element of y follows the relation mx+c. Your output should look something like following:

Input Array X: [-1 2 5 3 5 6]

Input Constants m: 5 and c: -2

Output Array Y: [-7 8 23 13 23 28]

  1. Write a C program that performs the matrix multiplication on two 8×8 matrices. Display your input matrices and final result matrix.

 

  • Lab2-ukjpjw.zip