Created
March 21, 2020 15:43
-
-
Save SOS77777/787b2abba0a9a0be4df91ad58b1f1248 to your computer and use it in GitHub Desktop.
This file contains 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
package ahmed; | |
import java.util.Scanner; | |
public class ahmed { | |
static Scanner a = new Scanner(System.in); | |
public static void main(String[] args) | |
{ | |
int sum=0 ; | |
int counter=0; | |
while(counter<4) { | |
System.out.println("Enter your number to add"); | |
int asd = a.nextInt(); | |
if(asd>100 || asd<0) { | |
System.out.println("invaild , enter new number"); | |
continue; | |
} | |
sum +=asd; | |
counter++; | |
}System.out.println("your number is " + sum); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
1