Source Code
import java.util.*;
public class MinMaxDAC {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter number of elements");
int n=sc.nextInt();
int a[]=new int[n];
System.out.println("Enter elements");
for(int i=0;i < n;i++)
a[i]=sc.nextInt();
int c=0,part=0, d, s;
while(part < n)
{
part=part+3;
c++;
}
part=0;
int l=0,h=2;
while(part < c)
{
System.out.println("The part of array is");
for(int i= l; i <= h; i++)
System.out.println(a[i] + " ");
System.out.println();
System.out.println("Maximum of this part of array is");
int v=a[l];
for(int i=l;i <= h;i++)
if(a[i] > v)
v=a[i];
System.out.println(v);
System.out.println();
System.out.println("Minimum of this part of array is");
int v1=a[l];
for(int i=l;i <= h;i++)
if(a[i] < v1)
v1=a[i];
System.out.println(v1);
System.out.println();
part++;
l=l+3;
if((h+3) < n)
h=h+3;
else
h=n-1;
}
d=s=a[0];
for(int i=0;i < n;i++)
{
if(a[i] > d)
d=a[i];
if(a[i] < s)
s=a[i];
}
System.out.println("Maximum element is:"+d);
System.out.println();
System.out.println("Minimum element is:"+s);
}
}
Output Aplication

tomorrow is my java book exmaz
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Ok, I will wait @sajda
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
wait for what?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
are u a programmer ?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i'm newbie programmer
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i m too
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
i made a website in c#
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Congratulations @ryal! You have completed some achievement on Steemit and have been rewarded with new badge(s) :
Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here
If you no longer want to receive notifications, reply to this comment with the word
STOP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit