Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SOS77777/787b2abba0a9a0be4df91ad58b1f1248 to your computer and use it in GitHub Desktop.
Save SOS77777/787b2abba0a9a0be4df91ad58b1f1248 to your computer and use it in GitHub Desktop.
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);
}
}
@SOS77777
Copy link
Author

1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment