Skip to content

Instantly share code, notes, and snippets.

@Furkan-Gulsen
Created April 18, 2022 19:45
Show Gist options
  • Save Furkan-Gulsen/4032d27f1bdcd98d6db42172d27b549c to your computer and use it in GitHub Desktop.
Save Furkan-Gulsen/4032d27f1bdcd98d6db42172d27b549c to your computer and use it in GitHub Desktop.
package Giris;
import java.util.Scanner;
public class Baslangic {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
int a, total = 0;
do{
System.out.print("Enter a number: ");
a = input.nextInt();
if(a % 4 == 0){
total += a;
}
}while( !(a % 2 == 1));
System.out.println("Result: " + total);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment