Computer Science, asked by gargshreya207, 1 year ago

write a program in java to print the structure for consecutive numbers whose sum is java

Answers

Answered by mrabhinav1289p1ajdm
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);
}
}
Similar questions