A repository for several interesting C++ projects.
PrimalityTesting This program is more concerned with producing better algorithm. The user inputs an integer to test whether it is a prime number or not. Instead of making the program loop through all of the numbers up until the inputted integer and finding whether the number is only divisble by 1 and the number itself, a better approach could be taken.
The loop should only until the square root of the inputted number, and this can be proven to be working with prove by contradiction. Only looping until the square root of the number makes the program significantly more efficient, as can be seen with the Big O notation (where the first approach has O(n)=n, while the second approach is O(n)=sqrt(n)).
Fibonacci Reads an integer from the user, and then returns the fibonacci sequence up until the read integer.
SolvingQuadraticEquation This program solves a quadratic equation, where the user enters 3 real numbers. The program calculates and gives the approriate response, with 2 solutions, 1 solution, no solution, no real solution, or a linear solution if the input happens to be a linear equation.
kCombinations This program calculates a combination using the equation below:
AnalyzeDigits Takes an integer input from the user, then it counts how many digits there are in the input, and sums up the individual digits together. The digit count and the sum of the digits are then returned.
TimeConversion This program converts time from 24-hour format to 12-hour format.
Parity Reads an integer input from user, then returns whether the input is even or odd.








