0% found this document useful (0 votes)
7 views1 page

Unit3Assignment Question2 PDF

Uploaded by

easonshi686
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views1 page

Unit3Assignment Question2 PDF

Uploaded by

easonshi686
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

package JAVA;

public class Assignment2 { // Declaration of the Assignment2


​ public static void main(String[] args) {// Main method - program execution begins
​ int i = 1; // Initialize number variable to 1
​ while (i <= 30) {// Continue looping as long as number is less than or equal to 30
​ System.out.print(i + " "); // Display the current value of number
​ i++;// Increment number by 1 after each iteration
​ } // Close while loop

​ } // Close main method


} // Close Question2 class

You might also like