Adding all digit of an interger between 0 and 1000

 

import java.util.*;
public class AddAllDigit {

public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the number");
int n = sc.nextInt();

int firstDigit = n % 10;
int secondDigit = remainingNo % 10;
remainingNo = remainingNo / 10;
int thirdDigit = remainingNo % 10;
remainingNo = remainingNo / 10;
int forthDigit = remainingNo % 10;

int sum = firstDigit + secondDigit + thirdDigit + forthDigit;
System.out.println("Sum of all digit of 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...