public class Sumof50 {
public static void main(String[] args) {
int sum = 0;
for (int i=1; i<=50; i++)
{
sum = i+sum;
};
System.out.println("Sum numbers from 1-50: " + sum);
}
}
No comments:
Post a Comment