class Pro16
{
public static void main(String arg[])
{
int i,a=0,n;
n=Integer.parseInt(arg[0]);
for(i=1;i<=n;i++)
{
if(i%2!=0)
{
a=a+i;
}
}
System.out.print("sum is "+a);
}
}
Tuesday, 4 June 2013
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment