Computer Science, asked by Yugarora0302, 9 months ago

Write a program in Java to generate the cube of first ten even numbers using While () loop.

Answers

Answered by yesiamin6
4

Answer:

public class Main

{

public static void main(String[] args)

{

int i=1,n=0;

while(n<10)

{

if(i%2==0)

{

System.out.println(i*i*i);

n++;

}

i++;

}

}

}

Explanation:

HOPE IT HELPS YOU

DO FOLLOW FOR MORE PROGRAMS

MARK AS BRAINLIEST

//OUT PUT IS ATTACHED LOOK AT THAT

Attachments:
Similar questions