Printing K smallest elements of an Array


 import java.util.*;
public class SmallestKEle{
public static void main(String args[]){
Integer arr [] = new Integer[] {11,2,23,9,4,100,50,63};
Scanner sc = new Scanner(System.in);
System.out.println("Enter value of K");
int k = sc.nextInt();
Arrays.sort(arr);
for(int i=0; i<k; i++){
System.out.print(arr[i]+",");
}
}
}

Google Script for Data Entry Form in Google Spreadsheet

// function to validate the entry made by user in user form function validateEntry (){ // declare a variable and referernece of active goog...