# Category Archives: School Programming

## Program to find Perimeter / Circumference of Square and Rectangle

The circumference of a figure is the sum of all the side lengths. To calculate the circumference of square, length of one of the side… Read More »

## Python Program to convert Kilometers to Miles

Kilometer is a unit of length in the metric system equivalent to 1000 meters. Miles is also the unit of length equal to 1760 yards.… Read More »

## Swap three numbers in cycle

Given three numbers, swap them in cyclic form. First number should get the value of third, second should get the value of first and third… Read More »

## Printing string in plus ‘+’ pattern in the matrix

Given a string, print it inside a matrix in such a way that a ‘plus’ is formed. Examples: Input: TOP Output: X T X T… Read More »

## Calculate Volume and Surface area Of Sphere

Given radius of sphere, calculate the volume and surface area of sphere. Sphere: Just like a circle, which geometrically is a two-dimensional object, a sphere… Read More »

## Calculate Volume, Curved Surface Area and Total Surface Area Of Cylinder

Given radius and height of Cylinder, calculate the volume, total surface area and curved surface area of cylinder. Volume of Cylinder: The volume of cylinder… Read More »

## Program for diamond pattern with different layers

Given a number n and using 0-n numbers you have to print such a pattern. Examples: Input : n = 5 Output : 0 0… Read More »

## Program to Calculate Body Mass Index (BMI)

The Body Mass Index (BMI) or Quetelet index is a value derived from the mass (weight) and height of an individual, male or female. The… Read More »

## Generate a pythagoras triplet from a single integer

Given a single integer n [1, 1000000000], generate a Pythagoras triplet which includes n as one of its sides if possible. Examples : Input :… Read More »

## Program to check for ISBN

An ISBN (International Standard Book Number) is a 10 digit number that is used to identify a book. The first nine digits of the ISBN… Read More »

## Calculate the Discriminant Value

In algebra, Discriminant helps us in deducing various properties of the roots of a polynomial or polynomial function without even computing them. Let’s look at… Read More »

## Program to check for Peterson number

A number is said to be a Peterson number if the sum of factorials of each digit of the number is equal to the number… Read More »

## Program to print alphabet “A” using stars

Given the number of lines n, print the alphabet A pattern using stars. Examples : Input : Number of lines : 5 Output : *… Read More »

## Inner reducing pattern printing

Given a number N, print the following pattern. Examples : Input : 4 Output : 4444444 4333334 4322234 4321234 4322234 4333334 4444444 Explanation: (1) Given… Read More »

## Print symmetric double triangle pattern

Given a value n, we need to print the following pattern accordingly, using only constant extra space. Examples: Input : n = 1 Output :… Read More »