User Profile
Collapse
-
i did most of the code all ready look for yourself -
im trying to exclude 300 and 500 from my program
//Sums all the numbers from 1 to 1000
//But excludes the numbers 300 and 500
//
public class Robert1
{
public static void main(String[]ARGS)
{
int sum;
int i;
for(i=1;sum=0;i <1000;i++)
if(
im stuck right hereLeave a comment:
-
-
-
ok my friends is this closer to what i need for this program
//Sums all the numbers from 1 to 1000
//But excludes the numbers 300 and 500
//
public class Robert1
{
public static void main(String[]ARGS)
{
int sum;
int i;
for(i=1;sum=0;i <1000;i++)
if(300=500+i;)
}
}
is this right yet thanksLeave a comment:
-
-
int sum = 0;
if (int i = 1; i <= 1000; ++i) {
sum += i;
while( )
}
is this betterLeave a comment:
-
I'm Just Learning Java I Know A Few Things Like You Need ; After Certain Things Also For This Program Ill Be Using A If, And A While Statement Within My Loop , I Just Dont Know How To Get It GoingLeave a comment:
-
// adds the numbers between 1 and 1000 excluding 300 and 500
//
int=sum;
sum=1;
this is as far as i can get i know i need a if and a while statement I know i need the while statement within my loop { }Leave a comment:
-
Java program that adds the numbers between 1 and 1000
how do i wright a java program that adds the numbers between 1 and 1000 but skips 300 and 500 any help on this matter i would greatly appreciate
thank you
No activity results to display
Show More
Leave a comment: