What do you want to save?
Add Code snippet
New code examples
-
Java 2021-10-06 19:17:03
is try and catch block catching only one exception
class Main { public static void main(String[] args) { try { int array[] = new int[10]; array[10] = 30 / 0; } catch (ArithmeticException e) { System.out.println(e.getMessage()); } catch (ArrayIndexOutOfBoundsException e) { ... Add solution -
C++ 2021-10-06 18:15:03
find kth max and min element in an array
#include <bits/stdc++.h> using namespace std; int main(){ const int size = 10; int k = 3; //Can be any number smalled than size int array[size] = {5,2,8,34,73,82,1,6,19,29}; sort(array,array+size); int smallestKthElement = array[k-1]; i... Add solution -
C++ 2021-10-05 01:00:05
inverser les éléments d'un tableau manuellement en c++
#include <iostream> using namespace std; int main() { int array1[5]={1,2,3,4,5}; int array2[5]; for(int i=0;i<5;i++) { array2[i]=array1[(5-i)-1]; cout<<"Number at index"<<i<<"="<<arr... Add solution -
Java 2021-10-03 12:44:04
How to find the length of an array in java
/** * An Example to get the Array Length is Java */ public class ArrayLengthJava { public static void main(String[] args) { String[] myArray = { "I", "Love", "Music" }; int arrayLength = myArray.length; //array length attribu... Add solution