WAP to print cubes of first 10 even numbers of the heavens
Answers
Answered by
2
Answer:
class A
{
public static void main(String args[ ])
{
int a=0,i=1, sum=0;
//METHOD 1
System.out.printl( 2,4,6,8,10,12,14,16,18,20);
//METHOD 2
for(i=1;a<=10;)
{ if (i%2==0)
{System.out.println(i)
a=1+a;
}
i=i+1;
}
}
}
Hope it helps. Follow for more answers.
Similar questions
Physics,
1 month ago
Social Sciences,
3 months ago
Math,
3 months ago
English,
10 months ago
History,
10 months ago