Computer Applications
Generate the following series upto 10 terms:
1, 4, 7,10 ……
Java
Java Iterative Stmts
28 Likes
Answer
public class KboatSeries
{
public static void main(String args[]) {
int t = 1;
for (int i = 1; i <= 10; i++) {
System.out.print(t + " ");
t += 3;
}
}
}
Output
Answered By
9 Likes
Related Questions
Generate the following series upto 10 terms:
1, 8, 27, 64, 125 ……..
Write a Java program using the switch case to print the corresponding days of numbers.
For example: 1= Monday…. 7 = Sunday
Generate the following series upto 10 terms:
0, 3, 8, 15, 24, 35 …..
Write a program to print all the prime numbers between 1 and 100.