-->

Hello,This is me!

ITEngineer8995

Professional Coder Coding is my passion

About me

Hello

I'mITEngineer8995

Spatial Data Specialist

Do you want all of your codes in one place?? Then you are landed on the right blog... Here you will find varieties of codes of various languages starting from noob to advance with their samples. Do learn, execute and share your knowledge with others. Do visit my YouTube Channel for execution of these codes .

Experience

Video Clone Detector using Hadoop

2017-2018

A detector which differentiates copied videos from the original ones using Hadoop.

Portfolio

Java Program To Find The Factorial Of A Number Using Recursion Entered By The User

 

Java Program To Find The Factorial Of A Number Using Recursion Entered By The User

In this Java Program, we calculate the factorial of the number using recursion entered by the user.

Factorial of n is the product of all the positive descending integers. It is denoted by n!

For example : 4! = 4 * 3 * 2 * 1 = 24

Logic : fact = fact * i;

Step 1 : Import Scanner Class

Step 2 : Create main method

Step 3 : Create scanner object for capturing the user input

Step 4 : Ask the user to enter the number

Step 5 : Store the entered value in the variable num

Step 6 : Call the user defined function fact

Step 7 : Print the number

Step 8 : Create a static function which returns 1

Step 9 : Create recursion function which calls itself

Program :

import java.util.Scanner;

public class FactorialDemo {

    public static void main(String[] args)

    {

        //Scanner object for capturing the user input

        Scanner sc = new Scanner(System.in);

        System.out.println("Enter the number:");

        //Store the entered value in variable

        int num =sc.nextInt();

        //Call the user defined function fact

        int factorial = fact(num);

        System.out.println("Factorial of entered number is:"+factorial);

    }

    static int fact(int n)

    {

        int output;

        if(n==1){

            return 1;

        }

                //Recursion: Function calling itself

        output = fact(n-1)*n;

        return output;

    }    

}

Output :

Enter the number:

5

Factorial of entered number is:120

For execution of the same do visit my YouTube Channel :

https://youtu.be/IBSxhMDbMrw


Java Program To Reverse a String Entered by the User

  

Java Program To Reverse a String Entered by the User

In this Java Program, we reverse a string entered by the user

Logic :  String reversed = reverseString(str);

Step 1 : Import Scanner Class

Step 2 : Create main method

Step 3 : Create variable str

Step 4 : Ask user to enter the username

Step 5 : Create the object of the Scanner Class

Step 6 : Store the user entered username in the variable str

Step 7 : Close the scanner class to avoid memory lea

Step 8 : Apply the logic

Step 9 : Print the reversed string

Step 10 : Create reversedString method

Step 11 : Apply if condition which says if str is empty then reverse string

Step 12 : Call the function recursively 

Program :

import java.util.Scanner;

public class JavaExample2 {

    public static void main(String[] args)

    {

        String str;

        System.out.println("Enter your username:");

        Scanner sc = new Scanner(System.in);

        str = sc.nextLine();

        sc.close();

        String reversed = reverseString(str);

        System.out.println("The reversed string is:"+reversed);

    }

    public static String reverseString(String str)

    {

        if(str.isEmpty())

            return str;

        //calling function recursively

        return reverseString(str.substring(1))+str.charAt(0);

    }

}

Output :

Enter your username:

how are you doing?

The reversed string is:?gniod uoy era woh

For execution of the same do visit my Youtube Channel :

https://youtu.be/GUoz8dR5d1E


Zara Zara Cover | Rehna Hai Tere Dil Mein

 ZARA ZARA



               SONG KEY : A MAJOR                                        CAPO : 7TH FRET
 

                CHORDS    :      A Major ,  D major,  F Major                                                                                

          

             STRUMMING PATTERN :

        

                                                        SONG 

Yuhi Baras Baras Kaali Ghata Barse, Ham Yaar Bheeg Jaaye, 

                        A                                                          D                          
Is Chahat ki Baarish Mein, Meri khuli khuli Laton ko Suljhaye

                         F                                                           A

Tu Apni Ungliyon Se, Me Toh Hu Ishi Khwayish Mein,

                          D                                                          F

Sardi Ki Raaton Me, Ham Soye Rahe Ek Chadar Mein,

      A             D                       F                                 D

Ham Dono Tanha Ho, Naa Koi Bhi Rahe Is Ghar Mein,

       A             D                        F                                D  


Zara Zara Behekta Hai, Mehekta Hai, Aaj Toh Mera,

         A                 D                     F                       D


Tan Badan, Mein Pyasi Hu, Mujhe Bhar Le Apni Baaho Mein,

           A                D                     F                        D

Haa Meri Kasam, Tujhko Sanam, Dur kahi Naa Jaa,

            A                           D                        F              D        
             
Yeh Duri, Kehti Hai, Pass Mere Aaja Re,

            A          D                  F             D 

MUSIC :

                  
               A          D                  F             D 

               A          D                  F             D 

Tadpaaye Mujhe Teri Sabhi Baatein, Ek Baar Aye Deewane,

             A                              D                         F                     D

Zhoota Hi Sahi, Pyaar Toh Kar,
   
    A           D            F           D  

Mein Bhuli Nahi Hasi Mulakatein, Baichain Karke Mujhko,

    A                           D                               F                   D

Mujhse Yu Na Fer Najar,  

     A         D        F        D        

Roothega Na Mujhse, Mere Sathiya Ye Vada Kar,

      A                   D                    F                       D                                              
Bin Tere Mushkil Hai, Jeena Mera Mere Dilbar,

       A                   D                    F                       D 

Zara Zara Behekta Hai, Mehekta Hai, Aaj Toh Mera,

         A                 D                     F                       D


Tan Badan, Mein Pyasi Hu, Mujhe Bhar Le Apni Baaho Mein,

           A                D                     F                        D

Haa Meri Kasam, Tujhko Sanam, Dur kahi Naa Jaa,

            A                           D                        F              D        
             
Yeh Duri, Kehti Hai, Pass Mere Aaja Re,

            A          D                  F             D 

MUSIC :

                  
               A          D                  F             D 

               A          D                  F             D

Visit My Youtube Channel For the Cover :

https://youtu.be/kmpyEVQLuwo

ITEngineer8995
India

SEND ME A MESSAGE

Search This Blog

Powered by Blogger.

Pages