/* SUM OF EVEN NUMBER */
import java.io.*;
class ssva18
{
public static void main(String arg[])
{
long n=0;
System.out.print("\nSUM OF EVEN NUMBERS IN BETWEEN 1 & 50\n\n\n");
for(int i=1;i<=50;i++)
{
if(i%2==0)
{
System.out.print(" "+i);
n=n+i;
}
}
System.out.println("\n\n\nSUM OF EVEN NUMBERS BETWEEN 1 & 50 IS : "+n);
System.out.println("\n");
}
}Java
Calculate Sum Of Even Numbers Using Java

Written by
View ProfileSenthilvelan Sambamoorthy
Senthilvelan Sambamoorthy is working as a Professor in Department of Master of Computer Applications, Paavai Engineering College, Namakkal, Tamilnadu, India, He is Masters in Computers Applications. Having 18+ years of experience and his area of interest is Java, JSP, Servlet, J2EE, C#, PHP, Python ASP.NET, SQL Server and etc.
