Filled Under:

answermid

Share
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author sohel
 */
public class star
{
 public static void main(String args[])
         {
          for(int i=0; i<=5 ;i++)
            {
              for(int j=0; j < i; j++)
              {
                  System.out.print(" *");
          
              }
              System.out.println("");
           }
       }
}







/**
 *
 * @author sohel
 */
import java.util.Scanner;
public class factorial
{
    public static void main(String argd[])
    {
        Scanner input=new Scanner(System.in);
        int x,i;
        int fact=1;
        System.out.println("Enter a valu: ");
        x=input.nextInt();
        for(i=1; i<=x; i++) {
            fact *= i;
        }
        System.out.printf("%d ",fact);
    }
}

0 মন্তব্য(সমূহ):

Post a Comment