Write a program to print following 1 3 6 10 15 21 28 sequence using for loop in java
Hello Friends Today I will Show You How We Can Print 1 3 6 10 15 21 28 sequence using for loop in java
First Create a Class And A function in your Ide or In Your Code editor
For Example
public class Print {
public static void main(String[] args) {
System.out.println("Program Completed");
}
}
In Next Step You Have To write A Login In for loop i am going to you
public class Print {
public static void main(String[] args) {
int sizeofseries=10;
for(int i=2,j=1; i<sizeofseries; i++)
{
System.out.println(j);
j+=i;
}
System.out.println("Program Completed");
}
}
if you want to take sizeofseries from user yo can follow How To Take input in java.
In This Post I have show you how you can print the following series
XMC.pl
Currently it is appropriate time to produce a few plans for the long run and its time to be happy. Ive learn this post and if I may just I want to suggest you some attention-grabbing issues or advice. Perhaps you can post subsequent articles relating to this blogpost. I wish to learn more things related to it!