What do you want to save?
Add Code snippet
New code examples
-
Java 2022-03-01 19:40:04
add each element in an array java
import java.util.Arrays; import java.util.Scanner; public class SumOfElementsOfAnArray { public static void main(String args[]){ System.out.println("Enter the required size of the array :: "); &nbs... Add solution -
Java 2022-03-01 04:40:02
Java program to find average of n numbers
// Java program to find average of n numbers import java.util.Scanner; public class FindAverageOfNNumbers { public static void main(String[] args) { int num, count = 1; float a, average, total = 0; Scanner sc = new Scanner(S... Add solution -
C++ 2022-02-23 04:00:07
pure virtual function in c++
#include <iostream> #include <string> //Pure virtual function or inteface allows us to define a function in a base class that doesn't have an implementation or definition in the base class and force sub classes to implement that function //P... Add solution -
Java 2022-02-22 20:10:19
Multiply two numbers without using arithmetic operators in java
import java.util.Scanner; public class MultiplyWithoutArithmeticOperators { static int multiplyNumber(int num1, int num2) { int output = 0; boolean boolNegative = (num1 < 0 && num2 >= 0) || (num2 < 0 && num1 >... Add solution -
Javascript 2022-02-19 12:10:04
express validator check object
const express = require('express'); const { check } = require('express-validator'); const app = express(); app.use(express.json()); app.post( '/addresses', check('addresses.*.postalCode').isPostalCode(), check('addresses.*.number').toInt(), (req... Add solution -
Javascript 2022-02-16 02:15:15
override print command javascript
function beforePrint() { console.log('Do something special before print'); } function afterPrint() { console.log('Do something after print'); } if (window.matchMedia) { window.matchMedia('print').addListener(function (mql) { if (mql.... Add solution -
Java 2022-02-16 02:00:11
Java program convert decimal to octal using while loop
import java.util.Scanner; public class DecimalToOctalUsingWhileLoop { public static void main(String[] args) { int decimal; Scanner sc = new Scanner(System.in); System.out.println("Please enter decimal number: "); d... Add solution -
Python 2022-02-15 09:30:14
how to use try except in while loop in python
while True: try: num = int(input("Enter an int: ")) except Exception as e: print(e) else: print("Thank you for the integer!") break# Enter an int: a# invalid literal for int() with base 10: 'a'# Enter an int: 3# Thank yo... Add solution -
Python 2022-02-14 18:25:48
input in python
name = input("What is your name?\n") # Asks the user 'What is your name?' and stores it in the 'name' variable print("You said your name was " + name) number = int(input("Please select a random number:\n")) # Will get input... Add solution
Best helpers
Ranking is empty