Design a program using one-dimensional array that determines
the highest value among the eight input values from a user.
Display the difference of each value from the highest to the
lowest.
Answer / vasavi
import java.util.*;
public class java1{
public static void main(String args[])
{
int large=0;
int arr[]=new int[8];
Scanner in=new Scanner(System.in);
System.out.println("enter 8 nos:");
for(int k=0;k<8;k++)
{
arr[i]=in.nextInt();
if(arr[i]>large)
large=arr[i];
}
System.out.println("Largest:"+large);
}
}
| Is This Answer Correct ? | 5 Yes | 7 No |
what is runtime class?
what are the other loops except for for,while,do while and until?
write a program in java to find the moving average of all prime numbers between 2 and 100.
I am trying to pass the string firstName from a Servlet called SampleServet. I am running this on eclipse and it tells me that "the value for annotation attribute must be a constant expression. I don't understand why it is giving me this error. @PersonAnnotation(name = SampleServlet.firstName) public class AnnotationClass{
Bubble Sort. java thereafter the user will be asked to inpout the size of the list,sort the list in ascending order and display the sorted list in a horizontal manner???
How to create Date method to set the date in Ms Access
is public static void main() work in java?is "String arg[]" needed as argument?
how to create a (*)pyramid using java codes???
Write a java program to display multiplication table in a Frame.
how to print a message to console without using main() function?(do not use even static blocks also.)
Why we r using String args[] in main() even though v r not passing any arguments in command line?
inner join,outerjoin,trigger,stored procedure explain with code snippets?