Page 25 - PowerPoint Presentation
P. 25

Conditional Operator











            o Conditional operator example




                                                  1       public static void main(String[] args){


                                                  2        int tea = sc.nextInt();


                                                  3        tea = (tea%2==1)?tea*2:tea/2;

                                                  4       }
   20   21   22   23   24   25   26   27   28   29   30