Advertisement
Md_Sakib_Hossain

Traversing Indexed Array

Mar 8th, 2021
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. public class TraversingIA{
  2.     public static void main(String[] args) {
  3.         int LA[] = {1,2,3,4,5};
  4.         int LB=0;
  5.         int K=LB; //step 1
  6.         int UB=4;
  7.         while(K<=UB){ //step 2
  8.         System.out.print(LA[K]+" "); // step 3 LA[K] will it will show you error because
  9.                                      //compiler said that this is not a statement only LA[K]
  10.         K++;  //step 4
  11.         }
  12.         System.out.print("\nExit"); // step 5
  13.  
  14.         // Just understant the fact thanks :)
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement