write a program in java to print the structure for consecutive numbers whose sum is java
Answers
Answered by
1
in java;
class cl
{
public static void main(String ar[])
{
int i,sum=0;
i=1;
while(i<=10)
{
sum+=i;
i++;
}
System.out.println(sum);
}
}
class cl
{
public static void main(String ar[])
{
int i,sum=0;
i=1;
while(i<=10)
{
sum+=i;
i++;
}
System.out.println(sum);
}
}
Similar questions
Social Sciences,
8 months ago
Math,
8 months ago
Social Sciences,
8 months ago
Accountancy,
1 year ago
Science,
1 year ago
Chemistry,
1 year ago