How do you swap positions of elements in an array?

 What is an arrayArray is the collection of similar types of data items.

How do you swap positions of elements in an array

  1. arr[]={1,3,2,5,6,7,8,9}; 
  2. first of all, create a temp variable 
  3. temp = arr[2]; 
  4. arr[2]= arr[5]; 
  5. arr[5] = temp; 
  6. print arr[5]; 

Comments

Popular posts from this blog

proassignment help backlink data index 41

programming shark backink data index 31

Programming shark backlink data index 67