Create run shortcut for your Favorite File

When you need your favorite file to open what do you do? Usually you go to that directory and then open that file. After a certain period of time you get bored of this and ask yourself isn’t there any way to open my most favorite file easily? My answer will be yes.

Here today I will introduce a way through which you will be able to open your favorite file just writing its name in the run command. You just have to follow some easy steps before you are done.

(more…)

Some Java program part 6

  1. Write a Java program that would input three numbers from the user and print sum, then the first number, then the 2nd number followed by 3rd number. If user enters 10, 20, 30. then output should be 60, 10, 20, 30.
import java.util.Scanner;
public class Lab8q4{
  public static void main ( String [] args ){
    int [] number = new int [3];
    int c = 0, sum=0;
    Scanner input = new Scanner ( System.in );
    System.out.println("Enter 3 numbers");
    while(c<3){
      number  = input.nextInt();
      sum = sum + number ;
      ++c;
    }
    System.out.println("SUM : "+sum);
    c=0;
    while(c<3){
      System.out.println(number);
      ++c;
    }
  }
}
  1. Write a Java program that would input ten numbers from the user and print the ten numbers in reverse order. If user enters 20, 10, 30, 15. Then output should be 15, 30, 10, 20.
import java.util.Scanner;
public class Lab8q5{
  public static void main ( String [] args ){
    int [] number = new int [3];
    int c = 0, sum=0;
    Scanner input = new Scanner ( System.in );
    System.out.println("Enter 3 numbers");
    while(c<3){
      number  = input.nextInt();
      sum = sum + number ;
      ++c;
    }
    c=2;
    while(c>=0){
      System.out.println(number);
      --c;
    }
  }
}

(more…)

Some Java programs part 4

16. Write a program that will read 10 numbers from the user, and then print the first number, the sum of the first 2 numbers, first 3 numbers, and so on up to the sum of 20 numbers.

/*Time : 5:00pm
 * Author: Anik das*/
import java.util.Scanner;
public class Faraz16{
  public static void main ( String [] args ){
    int c=1, sum=0, number;
    Scanner input = new Scanner ( System.in );
    while (c<=10){
      System.out.println("Enter Number #"+c);
      number = input.nextInt();
      sum=sum+number;
      System.out.println("Sum Of 1st "+c+" Number(s) is : "+sum);
      c++;
    }
  }
}

(more…)