Skip to content

Instantly share code, notes, and snippets.

View labgeek's full-sized avatar

JD labgeek

  • Seattle, WA
View GitHub Profile
@labgeek
labgeek / pointer.c
Created July 22, 2020 13:14
Simple hackerrank program - C
#include <stdio.h>
#include <math.h>
void update(int *a,int *b) {
int ans1, ans2;
ans1 = *a + *b;
ans2 = abs(*a-*b); //absolute via math.h
printf("%d\n%d", ans1, ans2);
}
@labgeek
labgeek / populate.c
Created July 20, 2020 12:56
Part of bigger program written to handle merge sort and quick sort analysis. Simple c program to randomize numbers up to 100 and pass back pointer to first element in array.
/**
* @author JD Durick
* @date 3/11/1998
* Assignment: part of bigger program written to handle
merge sort and quick sort analysis
*/
#include <stdio.h> //header file for input/output