This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
char* reverseString(char* s) { | |
int length = 0, i = 0; | |
length = strlen(s); | |
char temp[1]; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <cs50.h> | |
#include <math.h> | |
/** Write a program that first asks the user how much change is owed | |
and then spits out the minimum number of coins with which said change | |
can be made.*/ | |
int main(void) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <limits.h> | |
#include <stdbool.h> | |
int main(){ | |
int alice_score = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include <limits.h> | |
#include <stdbool.h> | |
int main(void) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <math.h> | |
#include <stdlib.h> | |
// https://www.hackerrank.com/challenges/circular-array-rotation | |
int main(void) | |
{ | |
int n, k, q; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <math.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
bool isPalindrome(int num); | |
int main(void) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* dictionary.c | |
* | |
* Computer Science 50 | |
* Problem Set 5 | |
* | |
* Implements a dictionary's functionality. | |
*/ | |
#include <stdbool.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// server.c | |
// | |
// Computer Science 50 | |
// Problem Set 6 | |
// | |
// feature test macro requirements | |
#define _GNU_SOURCE | |
#define _XOPEN_SOURCE 700 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bankAccount = prompt("How much money is in your bank account?"); | |
var spendingLimit = prompt("What is the max amount mof money do you wish to spend?") | |
var phonePrice = 100, accessoryPrice = 20, taxRate = 0.06, cost = 0; | |
function finalCheckout(amt) { | |
amt = amt + (amt * taxRate); | |
if (amt < bankAccount) | |
console.log("You can afford this!"); | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The company I work for creates custom acrylic cases based on customer's inputted dimensions. | |
// For fabrication our dimensions go down to the nearest 1/16th inch. | |
// International customers may use cm (or mm) and this is a program that will attempt to convert cm to inches | |
// down to the nearest 16th of an inch and display the result as a reduced fraction. | |
// 1 cm is equivalent to 0.39370 inches. | |
// EXAMPLE: 16.4 cm = 6 7/16 inches | |
// EXAMPLE: 10.5 cm = 4 2/16 or 4 1/8 inches |