write a program that displays that smallest even number in an integer array of size 10
Answers
Answer:
int a[]=new int[10];
int s=0;
for(int i=0;i<10;i++)
{
a[i]=Integer.parseInt(br.readLine());
if(a[i]%2==0)
{
s=a[i];
}
}
for(int j=0;j<10;j++)
{
if(a[j]%2==0&&a[j]<s)
{
s=a[j];
}
}
System.out.println(s);
Answer:
In order to have as few implementation dependencies as feasible, Java is a high-level, class-based, object-oriented programming language. Because it is a general-purpose programming language, compiled Java code can run on any platforms that accept Java without the need to recompile. This is known as writing once, running anywhere (WORA)[17]. [18] Regardless of the underlying computer architecture, Java applications are often compiled to bytecode that can run on any Java virtual machine (JVM). Although Java has fewer low-level features than either C or C++, it has syntax that is similar to each of them. Unlike most traditional compiled languages, the Java runtime has dynamic capabilities (such reflection and runtime code change).
int a[]=new int[10];
int s=0;
for(int i=0;i<10;i++)
{
a[i]=Integer.parseInt(br.readLine());
if(a[i]%2==0)
{
s=a[i];
}
}
for(int j=0;j<10;j++)
{
if(a[j]%2==0&&a[j]<s)
{
s=a[j];
}
}
System.out.println(s);
See more:
https://brainly.in/question/10354852
#SPJ5