top of page

2) Adding two number in Java

  • Writer: Mahesh Bhat M
    Mahesh Bhat M
  • Jun 29, 2017
  • 1 min read

Program :

class add{ public static void main(String args[]){ System.out.println(" Adding two numbers !"); int a=10,b=20,c=0; c=a+b; System.out.println(" Sum is " +c); } }

Program which is typed in notepad++

The ouput for the above program ( using Command Prompt )

 
 
 

Comments


Recent Posts

© 2023 by Kathy Schulders. Proudly created with Wix.com 

  • Grey Twitter Icon
bottom of page