What do you want to save?
Add Code snippet
New code examples
-
Java 2022-01-31 21:26:10
Java program to calculate average of 3 numbers
// Java program to calculate average of 3 numbers import java.util.Scanner; public class AverageNumberDemo { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.print("Please enter first number... Add solution -
Java 2022-01-23 09:26:17
count number of even and odd elements in an array in java
// count number of even and odd elements in an array in java import java.util.Scanner; public class CountEvenOddNumbersInArray { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int arrSize, a, countEven = 0,... Add solution -
Java 2022-01-23 06:21:06
Leap year using conditional operator in java
// Leap year using conditional operator in java import java.util.Scanner; public class LeapYearExample { public static void main(String[] args) { long number, year, a; Scanner sc = new Scanner(System.in); System.out.println("... Add solution -
TypeScript 2022-01-23 01:10:24
Java program to find the sum of all the digits in the inputted number
long number, sum; Scanner sc = new Scanner(System.in); System.out.println("Enter any DIGIT number: "); number = sc.nextLong(); sc.close(); // For Logic for adding all digits in the given number for (sum = 0; number != 0; number /= 10) { sum += ... Add solution -
Java 2022-01-22 19:20:09
Find minimum and maximum values in a java array
// Java program to find maximum and minimum number without using array import java.util.Scanner; public class MaximumMinimumWithoutArray { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println(&... Add solution -
Java 2022-01-22 10:21:17
Java convert octal to decimal
import java.util.Scanner; public class OctalToBinaryJava { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("Please enter octal number: "); int octal = Integer.parseInt(sc.n... Add solution -
Java 2021-11-21 21:17:16
Java program to find perimeter of a rectangle
import java.util.Scanner; public class PerimeterOfRectangleDemo { public static void main(String []args) { float length, width, perimeter; Scanner sc = new Scanner(System.in); System.out.print("Please enter length of recta... Add solution -
Java 2021-11-10 19:24:14
Java program to print Floyd's triangle
import java.util.Scanner; public class PrintFloydsTriangle { public static void main(String[] args) { int row, y, z, number = 1; Scanner sc = new Scanner(System.in); System.out.println("Enter the number of rows of floyd's tria... Add solution -
Java 2021-11-09 06:39:15
Java program to find largest in three numbers using ternary operator
// Java program to find smallest of three numbers using ternary operator import java.util.Scanner; public class SmallestOfThreeNumbers { public static void main(String[] args) { int number1, number2, number3, smallest, temp; Scanner sc... Add solution
Best helpers
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5