Adding all digit of any given integer

 

import java.util.Scanner;
public class AddingDigitOfINt{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
System.out.println("Enter an Integer between 1 and 1000");
int num = sc.nextInt();
int sum=0;
while(num>1){
int temp = num%10;
sum = sum+temp;
num = num/10;
}
System.out.println("Sum of all digits of the given number is = "+sum);
}
}

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...