Main method in Java

In Java, every application must contain a main method which serves as an entry point for the application similar to the main function in C and C++.

Sieve of Eratosthenes

Sieve of Eratosthenes is a very efficient algorithm that can be used in most coding competitions involving prime numbers in the range of a given number n.   The algorithm starts off by assuming that all the numbers in the range 2 to n are prime. Now we traverse the list starting from 2 to …

C program to print map of India

Write a C program to print map of India.     Below is obfuscated version in C that generates the map of India. Obfuscated code is any code that is difficult for humans to understand.

Program to find n’th Fibonacci number

Write a program to calculate n’th Fibonacci number where n is a given positive number.   Fibonacci sequence is characterized by the fact that every number after the first two is the sum of the two preceding ones. For example, consider below sequence – 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, …