class WhileExample
{
public static void main(String s[])
{
int n = 0;
int sum = 0;
int count = 10;
while( n <= 3 )
{
sum += (n * 2);
if( count < 7 )
{
break;
}
count--;
n++;
if( n % 2 == 0 )
{
sum = sum * 3;
}
}
System.out.println("sum = " + sum);
}
}
A. |
sum = 12 |
B. |
sum = 48 |
C. |
sum = 0 |
D. |
sum = 14 |
If you need explanation Read this topic
If you need Answer Take test on this topic