# Tag Archives: school-programming

## Predict the winner in Coin Game

There are two players P1 and P2 and two piles of coins consisting of M and N coins respectively. At each turn, a player can… Read More »

## Count of quadruplets with given Sum

Given four arrays containing integer elements and an integer sum, the task is to count the quadruplets such that each element is chosen from a… Read More »

## Check if given two straight lines are identical or not

Given two straight lines with co-efficients of there equations a1x + b1y + c1 = 0 and a2x + b2y + c2 = 0 respectively,… Read More »

## Area of triangle formed by the axes of co-ordinates and a given straight line

Given a straight line with equation coefficients as a, b & c(ax + by + c = 0), the task is to find the area… Read More »

## Distance between two parallel lines

Given are two parallel straight lines with slope m, and different y-intercepts b1 & b2.The task is to find the distance between these two parallel… Read More »

## Check whether the given string is a valid identifier

Given a string str, the task is to check if the string is a valid identifier or not. In order to qualify as a valid… Read More »

## Maximum difference between two elements in an Array

Given an array arr[] of N integers, the task is to find the maximum difference between any two elements of the array. Examples: Input: arr[]… Read More »

## Slope of the line parallel to the line with the given slope

Given an integer m which is the slope of a line, the task is to find the slope of the line which is parallel to… Read More »

## Count of elements whose absolute difference with the sum of all the other elements is greater than k

Given an array arr[] of N integers and an integer K, the task is to find the number of anomalies in the array. An anomaly is a number for… Read More »

## Find the sum of the number of divisors

Given three integers A, B, C, the task is to find ΣAi=1 ΣBj=1ΣCk=1 d(i.j.k), where d(x) is the number of divisors of x. Answer can… Read More »

## Program to calculate the number of odd days in given number of years

Given an integer N, the task is to find the number of odd days in the years from 1 to N. Odd Days: Number of… Read More »

## Largest ellipse that can be inscribed within a rectangle which in turn is inscribed within a semicircle

Given here is a semicircle of radius r, which inscribes a rectangle which in turn inscribes an ellipse. The task is to find the area… Read More »

## Remove the first and last character of each word in a string

Given the string the task is to remove the first and last character of each word in a string. Examples: Input: Geeks for geeks Output:… Read More »

## Capitalize the first and last character of each word in a string

Given the string, the task is to capitalise the first and last character of each word in a string. Examples: Input: Geeks for geeks Output:… Read More »

## Elements greater than the previous and next element in an Array

Given an array of N integers. The task is to print the elements from the array which are greater than their immediate previous and next… Read More »