Last active
November 15, 2018 08:31
-
-
Save canokay/1e7ddd4a0156042862eb236519f525f6 to your computer and use it in GitHub Desktop.
Java While Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class WhileExample { | |
public static void main(String[] args) { | |
int toplam=0; | |
System.out.println("Lütfen 5 sayi giriniz: "); | |
Scanner s=new Scanner(System.in); | |
int i=1; | |
while (i<6) { | |
System.out.println(i+". sayiyi giriniz: "); | |
int sayi=s.nextInt(); | |
toplam+=sayi; | |
i++; | |
} | |
System.out.println("Girdiginiz sayilarin toplami = "+toplam); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment