Write a Java program to print the following numbers 11,94,26
Answers
public class PrintName {
public static void main(String[] args) {
// for loop that prints "a name" ten times.
for (int i = 0; i < 10; i++) {
System.out.println("a name ");
}
}
}
This program would literally print “a name” ten times using the Java programming language. If you want to specify the name you want to print, just replace the text “a name” with the substitute name of your choice. This is how the program works, I use a for loop to print “a name” ten times. A for loop has three components: The initialization which is “int i = 0”, the condition which is “i < 10”, the iteration which is “i++”. The initialization determine the initial value of the variable you will use in your condition and iteration. In this case the variable “i” is initialize and set to a value of equal 0. The condition uses the initialize variable and compare it to another value, while this condition is true the code within the for loop will be executed which in this case is “i < 10” . The iteration will increment or decrement the initialize variable after the code within the for loop is executed which changes the value of the variable. This change in the variable value allows the condition to be possibly false. If the condition becomes false the code within the for loop will no longer execute. Each component of the for loop must be separated by a semicolon besides the iteration because it is the last statement. The code that is being executed by the for loop is:
System.out.println("a name ");
Thank you for reading my post
Have a nice day
MArk me as brainiest....!