Write a program that takes the values x and n from the user (Tom) and outputs the interest earned. Assume that x is a real number and n is a positive integer. If Tom inputs a negative integer for n the program should say "Invalid input" and exit.
The equation has no solution in real numbers if (b2-4ac) < 0. Write a program that takes as input the values a,b,c from the user and outputs "No solution exists" if there is no real number satisfying the equation and outputs the 2 real valued solutions otherwise. (Don't forget to include the < cmath > library).