* easy ** medium *** harder **** Dude, ouch!
hh:mm:ss (am|pm) Examples: 09:23:55 am , 12:03:01 pm
struct fraction f1 = {1,2}, f2 = {2,4}, f3 = {1,3}; if (equals(f1, f2)) // this should come out true printf("f1 and f2 are equal\n"); if (equals(f2, f3)) // this should come out false printf("f2 and f3 are equal\n");
firstString("doghouse", "Doggerel", "dogfood") // this function call should return "dogfood"
void strtrim(char* str);A sample call:
char buffer[40] = " The quick brown fox "; strtrim(buffer); printf("*%s*", buffer); // this prints: // *The quick brown fox*
void replaceAll(char* buffer, const char* oldstr, const char* newstr);The function should modify buffer so that all occurences of the string oldstr are replaced with newstr. Example:
char buf[80] = "Concatenate the bobcat with the catapult"; char str1[] = "cat"; char str2[] = "bird"; replaceAll(buf, str1, str2); puts(buf); // prints: "Conbirdenate the bobbird with the birdapult"
power(3,5) // returns 3 to the 5th power... which is 243
GCD(100,60) // returns 20
LCM(3,4,10) // returns 60, which is the smallest multiple of 3, 4, and 10.