Write a java program to print 1 3 6 10 15 21 28
Answers
Answered by
10
public class Basic
{
public static void main(String []args)
{
int a = 0;
for(int i = 1; i<8; i++)
{
a+= i;
System.out.println(a);
}
}
}
Hope this helps!
{
public static void main(String []args)
{
int a = 0;
for(int i = 1; i<8; i++)
{
a+= i;
System.out.println(a);
}
}
}
Hope this helps!
Similar questions