static void vietaFormula ( int roots [ ] , int n ) {
  int coeff [ ] = new int [ ++ n + 1 ] ;
  Arrays . fill ( coeff , 0 ) ;
  coeff [ n ] = 1 ;
  for ( int i = 1 ;
  i < n ;
  i ++ ) {
    for ( int j = n - i - 1 ;
    j < n ;
    j ++ ) {
      coeff [ j ] = coeff [ j ] + ( - 1 ) * roots [ i - 1 ] * coeff [ j + 1 ] ;
    }
  }
  System . out . print ( "Polynomial Coefficients: " ) ;
  for ( int i = n ;
  i > 0 ;
  i -- ) {
    System . out . print ( coeff [ i ] + " " ) ;
  }
}

static void vietaFormula ( int roots [ ] , int n ) { int coeff [ ] = new int [ ++ n + 1 ] ; Arrays . fill ( coeff , 0 ) ; coeff [ n ] = 1 ; for ( int i = 1 ; i < n ; i ++ ) { for ( int j = n - i - 1 ; j < n ; j ++ ) { coeff [ j ] = coeff [ j ] + ( - 1 ) * roots [ i - 1 ] * coeff [ j + 1 ] ; } } System . out . print ( " Polynomial ▁ Coefficients : ▁ " ) ; for ( int i = n ; i > 0 ; i -- ) { System . out . print ( coeff [ i ] + " ▁ " ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier) dimensions: (dimensions)) (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (binary_expression left: (update_expression (identifier)) right: (decimal_integer_literal)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (decimal_integer_literal)))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (binary_expression left: (parenthesized_expression (unary_expression operand: (decimal_integer_literal))) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))))))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (string_literal)))))))))