# Tag Archives: school-programming

## Reduce the fraction to its lowest form

Given two integers x and y and where x is divisible by y. It can be represented in the form of a fraction x/y. The… Read More »

## Times required by Simple interest for the Principal to become Y times itself

Given that a certain amount of money becomes T1 times itself in N1 years. The task is to find the number of years i.e. N2… Read More »

## Area of the biggest ellipse inscribed within a rectangle

Given here is a rectangle of length l & breadth b, the task is to find the area of the biggest ellipse that can be… Read More »

## Check if it is possible to create a polygon with given n sides

Given an array arr[] that contain the lengths of n sides that may or may not form a polygon. The task is to determine whether… Read More »

## Increment odd positioned elements by 1 and decrement even positioned elements by 1 in an Array

Given an array arr[], the task is increment all the odd positioned elements by 1 and decrement all the even positioned elements by 1. Examples:… Read More »

## Area of largest Circle inscribe in N-sided Regular polygon

Given a regular polygon of N sides with side length a. The task is to find the area of the Circle which inscribed in the… Read More »

## Replace the odd positioned elements with their cubes and even positioned elements with their squares

Given an array arr[] of n elements, the task is to replace all the odd positioned elements with their cubes and even positioned elements with… Read More »

## Determine the number of squares of unit area that a given line will pass through.

Given 2 endpoints (x1, y1) and (x2, y2) of a line, the task is to determine the number of squares of the unit area that… Read More »

## Program to calculate Double Integration

Write a program to calculate double integral numerically. Example: Input: Given the following integral. where Output: 3.915905 Recommended: Please try your approach on {IDE} first,… Read More »

## Count of buttons pressed in a keypad mobile

Given a string str, the task is to count how many times the keys will be pressed in total if there is a mobile like… Read More »

## Check if Matrix remains unchanged after row reversals

Given a NxN matrix. The task is to check if after reversing all of the rows of the given Matrix, the matrix remains same or… Read More »

## Smallest and Largest Palindrome with N Digits

Given a number N. The task is to find the smallest and largest palindromic number possible with N digits. Examples: Input: N = 4 Output:… Read More »

## Number of digits before the decimal point in the division of two numbers

Given two integers a and b. The task is to find the number of digits before the decimal point in a / b. Examples: Input:… Read More »

## Smallest odd number with N digits

Given a number N. The task is to find the smallest N digit ODD number. Examples: Input: N = 1 Output: 1 Input: N =… Read More »

## Smallest and Largest N-digit perfect cubes

Given an integer N, the task is to find the smallest and the largest N digit numbers which are also perfect cubes. Examples: Input: N… Read More »