Question #245779

Write a Java Program that make use of a loop to output 10 plus signs.

Each plus sign must be separated by a space as shown in the example below: + + + + +


Expert's answer

Source code


public class Main
{
	public static void main(String[] args) {
		int n=10;
		for(int i=0;i<n;i++){
		    System.out.print("+ ");
		}
	}
}


Output



LATEST TUTORIALS
APPROVED BY CLIENTS