What is the output of this program?
class array_output

Home | Discussion Forum

What is the output of this program?

class array_output
{
public static void main(String args[])
{
int array_variable [] = new int[10];
for (int i = 0; i < 10; ++i)
{
array_variable[i] = i/2;
array_variable[i]++;
System.out.print(array_variable[i] + " ");
i++;
}
}
}

View More Related Question

2) What is the output of this program?

class increment
{
public static void main(String args[])
{
int g = 3;
System.out.print(++g * 8);
}
}

3) What will be the output of these statement?

class output
{
public static void main(String args[])
{
double a, b,c;
a = 3.0/0;
b = 0/4.0;
c=0/0.0;
System.out.println(a);
System.out.println(b);
System.out.println(c);
}
}

4) What will the output of the following program?

public class Test{
public static void main(String args[])
{
float f = (1 / 4) * 10;
int i = Math.round(f);
System.out.println(i);
}
}

5) What is the output of this program?

class increment
{
public static void main(String args[])
{
double var1 = 1 + 5;
double var2 = var1 / 4;
int var3 = 1 + 5;
int var4 = var3 / 4;
System.out.print(var2 + " " + var4);
}
}

UP Gk Online Test

taiyari24hour.com

Study 2 Online Says....
Kindly log in or signup.