Write an algorithm to add two numbers.
Write an algorithm to add two numbers.
The algorithm takes two numbers as input, adds them, and displays the sum.
Write an algorithm to find the largest of two numbers.
The algorithm compares the two input values and displays the greater number.
Write an algorithm to find the area of a rectangle.
The algorithm accepts the length and width of a rectangle, calculates its area, and displays the result.
Write an algorithm to calculate the simple interest.
The algorithm takes the principal amount, rate of interest, and time as input and applies the simple interest formula.
Write an algorithm to check whether a number is even or odd.
The algorithm uses the modulus operator to find the remainder after dividing the number by 2. A remainder of 0 means the number is even; otherwise it is odd.
Write an algorithm to check whether a number is positive, negative, or zero.
The algorithm checks the value of N against zero and identifies whether the number is positive, negative, or zero.
Write an algorithm to find the largest of three numbers.
The algorithm compares all three input values and identifies the greatest number.
Write an algorithm to calculate the factorial of a number.
The algorithm initializes the factorial value to 1 and repeatedly multiplies it by each number from 1 to N.
Write an algorithm to reverse a given number.
The algorithm repeatedly extracts the last digit of the number and builds the reversed number using those digits.
Write an algorithm to find the sum of the first N natural numbers.
The algorithm starts with a sum of zero and adds each natural number from 1 to N. The final value is displayed as the result.