Top 100 Codes

PrepInsta Top 100 Codes
Below You will find some of the most important codes in languages like C, C++ and Java. These codes are of prime importance for college semester exams and also for various online tests and interviews of the companies offering placements within varying range in LPA.
These codes are very important since these will help you clear your basic concepts in various languages.
- Positive or Negative number: C | C++ | Java
- Even or Odd number: C | C++ | Java
- Sum of First N Natural numbers: C | C++ | Java
- Sum of N natural numbers: C | C++ | Java
- Sum of numbers in a given range: C | C++ | Java
- Greatest of two numbers: C | C++ | Java
- Greatest of the Three numbers: C | C++ | Java
- Leap year or not: C | C++ | Java
- Prime number: C | C++ | Java
- Prime number within a given range: C | C++ | Java
- Factorial of a number: C | C++ | Java
- Sum of digits of a number: C | C++ | Java
- Reverse of a number : C | C++ | Java
- Palindrome number: C | C++ | Java
- Armstrong number : C | C++ | Java
- Armstrong number in a given range : C | C++ | Java
- Fibonacci Series upto nth term : C | C++ | Java
- Factorial of a number : C | C++ | Java
- Power of a number : C | C++ | Java
- Factor of a number : C | C++ | Java
- Strong number : C | C++ | Java
- Perfect number : C | C++ | Java
- Automorphic number : C | C++ | Java
- Harshad number : C | C++ | Java
- Abundant number : C| C++ | Java
- Friendly pair : C | C++ | Java


- Highest Common Factor(HCF): C | C++ | Java
- Lowest Common Multiple (LCM) : C | C++ | Java
- Greatest Common Divisor : C | C++ | Java
- Binary to Decimal to conversion : C | C++ | Java
- Binary to Octal conversion : C | C++ | Java
- Decimal to Binary conversion: C | C++ | Java
- Decimal to octal Conversion: C | C++ | Java
- Octal to Binary conversion : C | C++ | Java
- Octal to Decimal conversion : C | C++ | Java
- Quadrants in which a given coordinate lies : C | C++ | Java
- Permutations in which n people can occupy r seats in a classroom : C | C++ | Java
- Maximum number of handshakes: C | C++ | Java
- Addition of two fractions: C | C++ | Java
- Replace all 0’s with 1 in a given integer : C | C++ | Java
- Can a number be expressed as a sum of two prime numbers
: C | C++ | Java
Important Codes related to Arrays
- Program for Pyramid star pattern
- Program for Pyramid number pattern
- Program for Palindromic pyramid pattern
- Program for Diamond star pattern
- Program for Diamond number pattern
- Program for Floyd’s Triangle
- Program for Pascal triangle
- Program for Smallest element in the array
- Program for Largest element in the array
- Program for Sum of elements in an array
- Program to Check array similarity
- Program for Reverse of an array.
- Program for Square sum
- Program for Second smallest element in the array
- Program for Longest palindrome in the array
- Program for Distinct element in the array
- Program for Non- repeating element in the array
- Program for Repeating element in an array
- Program for Minimum scalar product
- Program for Maximum scalar product
