Computer Science, asked by bcbht, 1 year ago

Wap to print the given series . -1,2-3,4-5,6 .............. till N term

Answers

Answered by Pranav777
1
\large{HEY MATE}

\underline{Here.is.your.Answer}

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 );
}
}
}
}

\boxed{Hope.it.helps}

\underline{Please. mark.as.Brainliest }
Similar questions