write a algorithm to print first ten natural number
Answers
Answered by
3
class Brainly //Class is created
{ //Class block opened
public static void check() //Method with user-defined name is created
{ //Method block opened
for( into k = 1; k<=10; k+ = 1 ) //Loop is created
{ //Loop block opened
System.out.println(k); //Prints value of k
} //Loop block closed
} //Method block closed
} //Class block closed
Output:
1
2
3
4
5
6
7
8
9
10
{ //Class block opened
public static void check() //Method with user-defined name is created
{ //Method block opened
for( into k = 1; k<=10; k+ = 1 ) //Loop is created
{ //Loop block opened
System.out.println(k); //Prints value of k
} //Loop block closed
} //Method block closed
} //Class block closed
Output:
1
2
3
4
5
6
7
8
9
10
Similar questions