Posts

Showing posts from September, 2021

Java programme to print name . java programme to print string .

package google ; import java.util.Scanner; public class nilesh {     public static void main (String args []){         Scanner s=new Scanner (System.in);         String   name =s.nextLine();         System.out.println("Hello "+name+" have a good day");         }}

Making a Calculator with the help of java programming.

Image
Copy the code below for practice. // nileshdeoree.blogspot.com package google ; import java.util.Scanner; public class Calculator {     public static void main (String args[]){         Scanner input=new Scanner (System.in);         char Y,condition,operator;         float a,b,result;         System.out.println("Enter your first number");         a=input.nextFloat();         System.out.println("Enter your second  number");         b=input.nextFloat();                  System.out.println("Enter an operator");         operator = input.next().charAt(0);                           switch(operator){             case  '+':            ...

Java programme to print number is even or odd with the method concept.

Image
For practice copy the code below. // Nileshdeoree.blogspot.com package Nileshdeore; import java.util.Scanner; public class evenodd   {         public static void main (String args[])     {         Scanner input= new Scanner (System.in);         System.out.println("Enter the number  ");         int num =input.nextInt();                  even_odd(num);  // Calling method     }          static void even_odd(int num)     {          if(num%2==0)          System.out.println (num+" is even");       else            System.out.println (num+" is odd");        }           }

Addition of Two decimal numbers in JAVA. How to add two decimal numbers in java

Image
Addition of Two decimal no in java. Click on below link :: Youtube video link for datailed explaination about code #3 For Practice Copy the code below:: package google; import java.util.Scanner; public class nileshdeore {     public static void main (String args[])     {         Scanner input = new Scanner (System.in);         float num1,num2,sum;         num1=input.nextFloat();         num2=input.nextFloat();         sum=num1+num2;         System.out.println("Sum of two decimal no is ::"+sum);         }}

Prints "Hello World" in JAVA. How to print hello world in java.

Image
Prints "Hello World" in JAVA. For the detailed explaination about code click on link below :: Youtube video link for detailed explination. #1 For Practice copy the code below :: package google; public class javawithnilesh {     public static void main (String args[])     {         System.out.println("'Hello World ");         } }

Addition of two numbers in JAVA . How to add two no in java language.

Image
JAVA Programme to add two numbers. For full detailed explaination click on below :: How to add two no in java youtube video link #2 Copy the code below for practice package microsoft ; import java.util.Scanner ; public class javawithnilesh {     public static void main (String args[])     {         Scanner input =new Scanner (System.in);         int a, b, sum ;         a = input.nextInt();         b= input.nextInt();         sum = a+b ;         System.out.println("Addition of two no  ::"+sum);         }}