C/C++ Mathematical Programs
Mathematical Algorithms in programming are the specialized method to solve arithmetic problems such as finding roots, GCD, etc. Most of us are familiar with the conventional methods and concepts used to solve such problems but they may not be the best choice in programming, such as the best choice for finding GCD in programming is Euclidean Algorithm.
In this article, we will discuss different optimal solutions for solving some common mathematical problems in C/C++.
Mathematical Practice Problems in C/C++
The following is the list of C/C++ programs based on the level of difficulty:
Easy
- Program for Fibonacci Numbers
- Efficient Way to Multiply with 7
- Check Divisibility by 7
- How to Check if a Given Number is Fibonacci Number?
- Multiply Two Integers without Using Multiplication, Division and Bitwise Operators, and No Loops
- Write Your Own Power without Using Multiplication(*) and Division(/) Operators
- Average of a Stream of Numbers
- Check Whether a Given Point Lies Inside a Triangle or Not
- Efficient Program to Print All Prime Factors of a Given Number
- Russian Peasant (Multiply Two Numbers Using Bitwise Operators)
Medium
- Program for Fibonacci Numbers
- Sieve of Eratosthenes
- Write an Efficient Method to Check if a Number is Multiple of 3
- Write a Program to Print All Permutations of Given String
- Lucky Numbers
- Write a Program to Add Two Numbers in Base 14
- Babylonian Method for Square Root
- Print all Combinations of Points that can Compose a Given Number
- Make a Fair Coin from a Biased Coin
- Shuffle a Given Array Using Fisher–yates Shuffle Algorithm
Hard
- Count Numbers That Don’t Contain 3
- Magic Square | ODD Order
- Find the Largest Multiple of 3 | Set 1 (Using Queue)
- DFA Based Division
- Generate Integer from 1 to 7 with Equal Probability
- Given a Number, Find the Next Smallest Palindrome
- Find Day of the Week for a Given Date
- Print All Permutations in Sorted (Lexicographic) Order
- Reservoir Sampling
- Lexicographic Rank of a String
Contact Us