Click here to Skip to main content
15,887,175 members
Home / Discussions / Java
   

Java

 
SuggestionRe: Max,Min,Average Pin
Richard MacCutchan30-Jan-15 21:53
mveRichard MacCutchan30-Jan-15 21:53 
GeneralRe: Max,Min,Average Pin
Ravi Bhavnani31-Jan-15 5:36
professionalRavi Bhavnani31-Jan-15 5:36 
GeneralRe: Max,Min,Average Pin
PinkPrint31-Jan-15 5:50
PinkPrint31-Jan-15 5:50 
GeneralRe: Max,Min,Average Pin
Ravi Bhavnani31-Jan-15 5:58
professionalRavi Bhavnani31-Jan-15 5:58 
GeneralRe: Max,Min,Average Pin
PinkPrint31-Jan-15 6:02
PinkPrint31-Jan-15 6:02 
GeneralRe: Max,Min,Average Pin
Richard MacCutchan31-Jan-15 6:11
mveRichard MacCutchan31-Jan-15 6:11 
AnswerRe: Max,Min,Average Pin
Akash gods6-Feb-15 7:02
professionalAkash gods6-Feb-15 7:02 
AnswerRe: Max,Min,Average Pin
Akash gods6-Feb-15 21:43
professionalAkash gods6-Feb-15 21:43 
//programm by askhgods Wink | ;)

import java.util.*;
public class array
{
public static void main(String args[])
{
int size=0,sum=0,avg=0,temp=0,f=0;
Scanner sc=new Scanner(System.in);
System.out.println("Enter size of array");
size=sc.nextInt(); //size of array to taking integer
int a[]=new int[size];
System.out.println("Enter input numbers in positive integer");
while(f<size)
{
a[f]=sc.nextInt();
if(a[f]<0)
{
break; //break and exit in negative value get inserted
}
f++;
}

if(f==size)
{
for(int i=0;i<size;i++)
{
sum=sum+a[i];
}
avg=sum/size; //avarage of integers value

//max and min with bubble sort techniche
for(int i=0;i<size-1;i++)
{
for(int j=0;j<size-i-1;j++)
{
if(a[j]<a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}

f=0;
int max=a[f];
int min=a[size-1];
//printing values thats u want Wink | ;)
System.out.println("\nAvarage of integers= "+avg+"\nMax integer value= "+max+"\nMin integer value= "+min);

//printing sorted list array to understand u easily
System.out.println("\nSorted list array ");
for(int i=0;i<size;i++)
{
System.out.println(a[i]);
}
}

}
}
QuestionJComponent cannot be resolved to a type Pin
Member 1141271229-Jan-15 8:10
Member 1141271229-Jan-15 8:10 
SuggestionRe: JComponent cannot be resolved to a type Pin
Richard MacCutchan29-Jan-15 23:06
mveRichard MacCutchan29-Jan-15 23:06 
AnswerRe: JComponent cannot be resolved to a type Pin
TorstenH.30-Jan-15 2:08
TorstenH.30-Jan-15 2:08 
QuestionDesigning persistence layer for java application Pin
vaibhavndave23-Jan-15 7:46
vaibhavndave23-Jan-15 7:46 
AnswerRe: Designing persistence layer for java application Pin
TorstenH.27-Jan-15 21:22
TorstenH.27-Jan-15 21:22 
QuestionJCheckBox working with check boxes inside of JTable Pin
Member 1114435719-Jan-15 6:20
Member 1114435719-Jan-15 6:20 
AnswerRe: JCheckBox working with check boxes inside of JTable Pin
TorstenH.22-Jan-15 20:31
TorstenH.22-Jan-15 20:31 
GeneralRe: JCheckBox working with check boxes inside of JTable Pin
Member 1114435729-Jan-15 1:51
Member 1114435729-Jan-15 1:51 
QuestionHow do I add values in JTable Pin
Member 1114435716-Jan-15 4:35
Member 1114435716-Jan-15 4:35 
QuestionRe: How do I add values in JTable Pin
Richard MacCutchan16-Jan-15 4:51
mveRichard MacCutchan16-Jan-15 4:51 
AnswerRe: How do I add values in JTable Pin
Member 1114435716-Jan-15 9:17
Member 1114435716-Jan-15 9:17 
GeneralRe: How do I add values in JTable Pin
Richard MacCutchan16-Jan-15 22:30
mveRichard MacCutchan16-Jan-15 22:30 
GeneralRe: How do I add values in JTable Pin
Member 1114435717-Jan-15 7:27
Member 1114435717-Jan-15 7:27 
QuestionJava Pin
Angel Roy2-Jan-15 0:45
Angel Roy2-Jan-15 0:45 
AnswerRe: Java Pin
Richard MacCutchan2-Jan-15 4:56
mveRichard MacCutchan2-Jan-15 4:56 
QuestionHi friends I need some help regarding the following program will you please help me Pin
Leela Krishna Yadav1-Jan-15 18:10
Leela Krishna Yadav1-Jan-15 18:10 
QuestionRe: Hi friends I need some help regarding the following program will you please help me Pin
Richard MacCutchan1-Jan-15 22:30
mveRichard MacCutchan1-Jan-15 22:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.