Computer Science, asked by Vibhor16, 1 year ago

Write a java program to print 1 3 6 10 15 21 28

Answers

Answered by siddhartharao77
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!
Similar questions