java program to find sum of n even numbers which are divisible by 3.
Answers
Answered by
0
Answer:
import....
class xyz
{
psvm
int n,i,sum=0;
ISR
BR
sopln("enter the value of n");
n=Integer.parse.....
sopln("enter n number");
i=Integer.parse....
for(i=0;i<=n;i++)
{
if(i%2==0 && i%3==0)
sum=sum+i;
}
sopln("the sum of even nos divisible by 3 are= "+sum);
}
Similar questions
Social Sciences,
6 months ago
India Languages,
6 months ago
English,
1 year ago
Environmental Sciences,
1 year ago
Environmental Sciences,
1 year ago
Science,
1 year ago