Computer Applications
Write a program to print following series of numbers: 2, 5, 8, 11, 14….
Java
Java Iterative Stmts
9 Likes
Answer
public class KboatSeries
{
public static void main(String args[]) {
for (int i = 2; i <= 100; i += 3) {
System.out.print(i + " ");
}
}
}
Variable Description Table
Program Explanation
Output
Answered By
1 Like
Related Questions
Palindrome Number in Java: Write a program to accept a number from the user and check whether it is a Palindrome number or not. A number is a Palindrome which when reads in reverse order is same as in the right order.
Sample Input: 242
Sample Output: A Palindrome numberSample Input: 467
Sample Output: Not a Palindrome numberWrite a program to print factorial of a given number.
Write a program to input a number in the range 10 to 100 and check if it is a prime number.
Write a program to print Fibonacci series : 0, 1, 1, 2, 3, 5, 8….