Simple Java practice programs

runnung_java_program

Setting Environment variables

  • Right click on This PC icon on the desktop
  • Go to Advanced system settings
  • Go to Advanced tab
  • Click Environment variables
  • Under system variables, highlight Path
  • Now click Edit button
  • Place semicolon & copy, paste the path where Java (jdk) is installed [till bin]
    For example: C:\Program Files (x86)\Java\jdk1.6.0\bin

runnung java program

compile program from command line

sum of two numbersarea of a square

area of a rectangle

area of triangle with 3 sidesarea and perimeter of a square

average of 3 numbersgreatest of 2 numberssimple interest

swapping two variablesfahrenheit to celsius

factorial of a numbersum of integers from 1 to 100

sum of n natural numberssquares of n natural numbers

sum of even numbers upto nproduct of numbers upto n

sum of first 50 odd numbers

Gopal Krishna

Hey Engineers, welcome to the award-winning blog,Engineers Tutor. I'm Gopal Krishna. a professional engineer & blogger from Andhra Pradesh, India. Notes and Video Materials for Engineering in Electronics, Communications and Computer Science subjects are added. "A blog to support Electronics, Electrical communication and computer students".

Leave a Reply

Your email address will not be published. Required fields are marked *

Translate »