What do you want to save?
Add Code snippet
New code examples
-
Java 2022-02-01 06:50:15
Display even and odd numbers in java using for loop
import java.util.Scanner; public class FindEvenOrOdd { public static void main(String[] args) { int a; Scanner sc = new Scanner(System.in); System.out.println("Please enter a number to check even or odd: "); a = sc.... Add solution -
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-29 21:25:51
how to make a calculator using switch case in java
/* Create Switch cases */ Scanner sc= new Scanner(System.in); int firstNum= sc.nextInt(); int secondNum= sc.nextInt(); System.out.println("Enter an operator (+, -, *, /):"); char operator= sc.next().chartAt(0); double result=0; switch(operator){... Add solution -
Javascript 2022-01-27 01:16:08
swap nodes algo hackerrank solution
import java.io.*; import java.math.*; import java.text.*; import java.util.*; import java.util.regex.*; public class Solution { /* * Complete the swapNodes function below. */ static class Node { int index; int depth; ... 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