Computer Science, asked by aps450, 11 months ago

how to write Java program description list

Answers

Answered by Vasudevrao5555
0

public class Hello

{

/* Author: www.w3schools.in

Date: 2018-04-28

Description:

Writes the words "Hello Java" on the screen */

public static void main(String[] args)

{

System.out.println("Hello Java");

}

}

Answered by Anonymous
1

class Factorial

{

   public static void main(String args[])

   {

       int fact=1;

       for(int i=1;i<=5;i++)

       {

           fact=fact*i;

       }

       System.out.println("Factorial of 5 is"+fact);

   }

}

Variable Name         Variable Type                            Purpose

  1. Args                  String[]               To accept command line arguments.
  2. i                         int                      To iterate the for-loop for calculation.
  3. fact                    int                      To store the value of the factorial.                                                                                                                                                                    

Similar questions