Commit 502ee615 by Gürcan Güleç

adding a few things to homework2.c

parent fc8b0469
Showing with 16 additions and 6 deletions
/**
* File: homework2.c
* Author: Gurcan Gulec
* Created: 6 December 2016
* Last Edit: 9 December 2016
*
* Description: Homework 2.
*
*/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h> #include <time.h>
// to limit random created numbers between certain values
int rndHigh = 100;
int rndLow = 1;
int clerk;
// filling the matrix with random values // filling the matrix with random values
void fillMatrix(int arr[100][100], int row, int column) void fillMatrix(int arr[100][100], int row, int column)
{ {
int rndHigh = 100;
int rndLow = 1;
for (int i = 0; i<row; i++) for (int i = 0; i<row; i++)
{ {
for (int j = 0; j<column; j++) for (int j = 0; j<column; j++)
...@@ -41,7 +49,7 @@ void readMatrix(int arr[100][100], int row, int column) ...@@ -41,7 +49,7 @@ void readMatrix(int arr[100][100], int row, int column)
} }
} }
//finding the totals in each column // finding the totals in each column
void findTotals(int arr[100][100], int row, int column) void findTotals(int arr[100][100], int row, int column)
{ {
printf(" Total"); printf(" Total");
...@@ -57,6 +65,7 @@ void findTotals(int arr[100][100], int row, int column) ...@@ -57,6 +65,7 @@ void findTotals(int arr[100][100], int row, int column)
printf("\n"); printf("\n");
} }
// finding the clerk that is most productive
void findClerk(int arr[100][100], int row, int column) void findClerk(int arr[100][100], int row, int column)
{ {
int clerk; int clerk;
...@@ -79,6 +88,7 @@ void findClerk(int arr[100][100], int row, int column) ...@@ -79,6 +88,7 @@ void findClerk(int arr[100][100], int row, int column)
printf("\n"); printf("\n");
} }
// displaying the matrix
void displayMatrix(int arr[100][100], int row, int column) void displayMatrix(int arr[100][100], int row, int column)
{ {
readMatrix(arr,row,column); readMatrix(arr,row,column);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment