Wap to print the given series . -1,2-3,4-5,6 .............. till N term
Answers
Answered by
1
public class
{
public static void main ( int n )
{
int x ;
for ( x = 1 ; x <= n ; x++ )
{
if ( x%2 == 0 )
{
System.out.print ( x );
}
else
{
System.out.print ( x × -1 );
}
}
}
}
Similar questions