Skip to content

Instantly share code, notes, and snippets.

View ykamal's full-sized avatar
🤨
Darn AI Marketing Mania

Yousof K. ykamal

🤨
Darn AI Marketing Mania
View GitHub Profile
@ykamal
ykamal / SingleDigitSum.java
Last active May 14, 2019 18:17
Take some numbers, keep summing the numbers till they turn into a single digit. Example: 10 + 10 + 10 = 30. 3 + 0 = 3.
import java.util.Scanner;
public class SingleDigitSum {
public static void main(String[] args) {
int numbersToInput = 3; // how many numbers to take
int[] numbers = new int[numbersToInput]; // numbers array
int sum = 0; // we store the sum here
// initialize scanner