Revision- 10

Area of Circle

Steps


Finding GCD using Euclid's  algo

Steps

a. Set 'temp' equal to the value of 'y'. 

b. Set 'y' equal to the remainder when 'x' is divided by 'y'. 

c. Set 'x' equal to the value of 'temp'.


Functions in Java 

Steps

a. Determine the purpose of the function and its return type. 

b. Choose a descriptive function name that reflects its functionality. 

c. Define the parameters the function requires, specifying their types and names.

a. Begin the function body by specifying the return type (void if no return value). 

b. Implement the desired functionality using statements and control flow structures. 

c. If applicable, use the return keyword to return a value of the specified return type.

a. Identify the location in the code where the function should be called. 

b. Provide arguments that match the function's parameter list, if any.


Number Systems


The Decimal Number System, also known as the Base-10 system, is the number system most commonly used by humans. It is called "decimal" because it utilizes ten distinct symbols or digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. Each digit's positional value is based on powers of 10. The rightmost digit represents the units place, the next digit represents the tens place, and so on. For example, the number 537 in the decimal system represents (5 x 10^2) + (3 x 10^1) + (7 x 10^0) = 500 + 30 + 7 = 537.


The Binary Number System, also known as the Base-2 system, is a fundamental number system in computer science and digital electronics. It consists of only two digits: 0 and 1. Each digit's positional value is based on powers of 2. The rightmost digit represents the units place (2^0), the next digit represents the twos place (2^1), the following digit represents the fours place (2^2), and so on. For example, the binary number 101 represents (1 x 2^2) + (0 x 2^1) + (1 x 2^0) = 4 + 0 + 1 = 5 in the decimal system.


Decimal to Binary

Modulo Operator

In simple terms, the modulo operation finds the remainder after division of one number by another. This operator is particularly useful in various scenarios such as checking for even/odd numbers.


Example: Checking Even or Odd

Problem

Check if a number is even or odd using the modulo operator.



Approach