Page 39 - CTS - CSA TP - Volume 2
P. 39

COMPUTER SOFTWARE APPLICATION - CITS




           TASK 13: Java Assignment Operator Example

           public class OperatorExample13{
           public static void main(String[] args){
           int a=10;
           a+=3;//10+3

           System.out.println(a);
           a-=4;//13-4
           System.out.println(a);
           a*=2;//9*2
           System.out.println(a);
           a/=2;//18/2

           System.out.println(a);
           }}
           Output:


























































                                                           24
                                CITS : IT & ITES - Computer Software Application - Exercise 82
   34   35   36   37   38   39   40   41   42   43   44