AmitDiwan has Published 11359 Articles

Java Program to Find the Perimeter of a Circle

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 13:18:08

834 Views

In this article, we will understand how to find the perimeter of a circle. The circumference is the perimeter of a circle. It's the distance around a circle.Circumference is given by the formula C = 2𝜋\pi r where, \pi𝜋 = 3.14 and r is the radius of the circle −Below ... Read More

Java Program to Find the Area of a Trapezium

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 13:14:53

541 Views

In this article, we will understand how to find the area of a trapezium. Trapezium is a type of quadrilateral that has at least one pair of side parallel to each other. The parallel sides of a trapezium are called bases and the non-parallel sides of a trapezium are called ... Read More

Java Program to Reverse a Number

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 13:04:36

461 Views

In this article, we will understand how to print an integer in Java. The reverse of a number is computed using a loop and arithmetic operator % and /.Below is a demonstration of the same −InputSuppose our input is −The number : 123456OutputThe desired output would be −The result is ... Read More

Java Program to Print the Multiplication Table in Triangular Form

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 12:52:45

259 Views

In this article, we will understand how to print multiplication table in triangular form. Printing multiplication table in triangular form is achieved using a loop.Below is a demonstration of the same −InputSuppose our input is −Input : 7OutputThe desired output would be −The result is : 1 2 4 3 ... Read More

Java Program to Generate Multiplication Table

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 12:43:21

808 Views

In this article, we will understand how to print a multiplication table. Multiplication table is created by iterating the required input 10 times using a for loop and multiplying the input value with numbers from 1 to 10 in each iteration.Below is a demonstration of the same −InputSuppose our input ... Read More

Java Program to Round a Number to n Decimal Places

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 12:39:49

252 Views

In this article, we will understand how to round a number to n decimal places. Rounding of decimal values are done using the CEIL or FLOOR functions.Below is a demonstration of the same −InputSuppose our input is −Input : 3.1415OutputThe desired output would be −Output : 3.2 AlgorithmStep 1 - ... Read More

Java Program to Check if two of three Boolean variables are true

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 12:30:36

337 Views

In this article, we will understand how to check if two of three Boolean variables are true. Boolean variables are datatypes that can contain only true or false values.Below is a demonstration of the same −InputSuppose our input is −Input : true, true, falseOutputThe desired output would be −Result : ... Read More

Java Program to Iterate over enum

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 12:29:45

186 Views

In this article, we will understand how to iterate over enum objects. Enum is a datatype that represents a small collection of objects.Below is a demonstration of the same −InputSuppose our input is −Enum objects are defined as : red, blue, green, yellow, orangeOutputThe desired output would be −Printing the ... Read More

Java Program to Count the Number of Vowels and Consonants in a Sentence

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 11:34:59

2K+ Views

In this article, we will understand how to count the vowels and consonants in Java. Alphabets that include 'a' 'e' 'i' 'o' 'u' are called Vowels and all other alphabets are called Consonants.Below is a demonstration of the same −InputSuppose our input is −Hello, my name is CharlieOutputThe desired output ... Read More

Java Program to Compute Quotient and Remainder

AmitDiwan

AmitDiwan

Updated on 21-Feb-2022 11:12:33

764 Views

In this article, we will understand how to compute the quotient and reminder in Java. Quotient and Reminder is calculated using two simple formula "Quotient = Dividend / Divisor" and "Remainder = Dividend % Divisor".Given an integer a and a non-zero integer d, it can be shown that there exist ... Read More

Advertisements