uk
Feedback
Java Codes Basic to Advance

Java Codes Basic to Advance

Відкрити в Telegram
2 333
Підписники
Немає даних24 години
-37 днів
-2030 день
Архів дописів
Inverted half pyramid of number .
public class invertedpyra {
    public static void Inverted_half_pyramid(int n) {
        for (int i = 1; i <= n; i++) {
            // inner loop

            for (int j = 1; j <= n - i + 1; j++) {
                System.out.print(j);

            }
            System.out.println();
        }
    }
    public static void main(String[] args) {
        Inverted_half_pyramid(6);
    }
}
Output:
123456       
12345
1234
123
12
1

Inverted Half Rotated Pyramid
public class invertrothalfpyramid {
    

    public static void inverted_half_pyramid(int n) {
        // outer loop
        for (int i = 1; i <= n; i++) {
            // empty space
            for (int j = 1; j <= n - i; j++) {
                System.out.print(" ");

            }
            // star
            for (int j = 1; j <= i; j++) {
                System.out.print("*");

            }
            System.out.println();

        }

    }

    public static void main(String[] args) {
        // InvertedHalfPiramid(4, 4);
        inverted_half_pyramid(4);

    }
}
Output:
   *
  **
 ***
****

Print Hollow Rectangle Pattern using java .
public class Hollowrect {
    public static void HollowrectPattern(int noOfRows, int noOfCols) {
        // for rows outer loop
        for (int i = 1; i <= noOfRows; i++) {
            // inner loop
            for (int j = 1; j <= noOfCols; j++) {
                // cell (i,j)
                if (i == 1 || i == noOfRows || j == 1 || j == noOfCols) {
                    System.out.print("*");

                } else {
                    System.out.print(" ");
                }

            }
            System.out.println();

        }

    }

    public static void main(String[] args) {
        HollowrectPattern(4, 7);

    }
}
OutPut:
*******
*     *
*     *
*******

Reverse Decreasing Star pattern of number n
******
*****
****
***
**
*
CODE :
 

public class pattern1 {

    public static void reverseStar(int n) {
        // reverse pattern
        for (int i = n; i >= 0; i--) {
            for (int j = 1; j <= i; j++) {
                System.out.print("*");

            }
            System.out.println();

        }

    }

    public static void main(String[] args) {
        reverseStar(6);

    }

}

Write a Java program to check if a number is a palindrome in Java?
import java.util.*;

public class quest3 {
    // Write a Java program to check if a number is a palindrome in Java? ( 121 is a
    // palindrome,321 is not) A number is called a palindrome if the number is equal
    // to the reverse of a number e.g.,121 is a palindrome because the reverse of
    // 121 is 121 itself. On the other hand,321 is not a palindrome because the
    // reverse of 321 is 123, which is not equal to 321
    public static void isPalindrome(int num) {
        int orignalnum = num;
        int palindrome = 0;
        while (num > 0) {
            int remind = num % 10;
            num = num / 10;
            palindrome = palindrome * 10 + remind;

        }

        System.out.print(palindrome == orignalnum);

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter any number: ");
        int num = sc.nextInt();
        isPalindrome(num);

    }
}

We have started new Channel. Is channels me aapko 8000 se lekar 1lack+ salary ke jobs achive karne ke liye kya skills required hoti hain unke bare me batayenge. Kya kya jaroori hota hai cv, experience, education and knowledge se lekar bahut kuchh Har ek field jaise accounting, Software development se lekar Har tarah ke work ki skills. To wait karne ki bajay join karlo👇 @NaukriSkills

Jinke pass bhi Groups hain 10 members se 250 members tak ke vo mujhe de sakte hain (Only telegram groups no newly created) And don't comment here directly message me Minimum Price 50 rupye maximum price can be 100 vary based on group And in special group case it will be more @Panditsiddharth Or Call 6389680622

Jinke pass bhi Groups hain 10 members se 250 members tak ke vo mujhe de sakte hain (Only telegram groups no newly created) And don't comment here directly message me Minimum Price 50 rupye maximum price can be vary based on group Keemat aapke hisab se @Panditsiddharth Or Call 6389680622

.

Agar aapko koi bhi course chahiye Apna college, PhysicWallah, unacademy, namaste dev, harkirat Singh cohort, love babbar, sanket Singh, Ashok IT, Durga soft, Naresh IT, sherians coding, Hitesh Choudhary, Anuj bhaiya, sabhi premium course aapko actuall price ka only 1% me milegaa
Agar koi course 10000 ka hai to only 100 rupess me
Aur free course k liye aap aap join krlo bahut helpful hai sb milega
https://t.me/addlist/vnAFuK9rY6FjNjM1 ✅Course k liye @Myhurthearts ko DM kare Genuine and trusted seller ✅

Hey Students! Ready to Launch Your IT Career? ITintern starting new batches for online internships! 🔥 New Batches Starting from 1st November! 🔥 🌐 Internships Available in: ✅ Web DevelopmentPython ProgrammingJava Programming 💠 Learn by Doing Work on live projects 💠 Boost Your Skills with Projects & Take your knowledge on tests with quizzes 💠 Get Feedback on projects from the community 💠 Get certified in your skill ⚡ Join the Community of Future Tech Leaders!! 👉 Visit: ITintern.in Follow us on social media for Updates LinkedIn | Instagram | X | FaceBook Dashboard: ITintern.in/student More Programms : ITintern.in/courses Your Journey Starts Here! 🎯 -Ad (Trusted)

https://t.me/hamsteR_kombat_bot/start?startapp=kentId1791106582 Hamster kombat is samay sabse accha bot hai earning ka jisne bhi abhi ise play nhi kiya vo ek bar try karke dekhe 💸 2k Coins as a first-time gift 🔥 25k Coins if you have Telegram Premium

In these days rust is getting much popular 1) Because of it's speed of execution. 2) It's full controll on system memory 3) it's ownership model 4) And integration to other languages So why wait let's join our rust channel https://t.me/Rust_Codes_Pro

आप सभी को स्वतंत्रता दिवस की हार्दिक बधाई 🇮🇳🇮🇳

Become Termux Expert in Hindi Series Video No.: 7 | Change Termux Permission https://youtu.be/53b40lkce3s

1. भारतीय संविधान को लिखने का कार्य किसने किया था? - भारतीय संविधान को प्रेम बिहारी नारायण रायज़ादा ने अंग्रेजी में और वसंत कृष्ण वैद्य ने हिंदी में हाथ से लिखा था। 2. संविधान सभा का अध्यक्ष कौन था? - ..... More details join: https://t.me/SidsAnalysis/38 Join for daily intrusting knowledge

Create any compiler and run on your own compiler any code https://youtu.be/4EE-D341z6c

Join our main support Group for coders: @BCA_MCA_BTECH More: https://t.me/addlist/hiZsuZYwYzJmMWQ1

Create own advanced realtime io compiler bot on telegram See full tutorial: https://telegram.me/logicBots/226 All coding channels: https://t.me/addlist/hiZsuZYwYzJmMWQ1

Government ne google ki dadagiri ko khatm karne ke liye apna khud ka app store banaya hai 🔥😍 Playstore pe jo apps hain unhe
Government ne google ki dadagiri ko khatm karne ke liye apna khud ka app store banaya hai 🔥😍 Playstore pe jo apps hain unhe 30% Playstore ko apni kamayi ka hissa dena padta hai https://apps.mgov.gov.in/details?appid=270 Aap sabhi ye government playstore ko download kare Aur logo ko bhi share Kare Government ne to apna Kam Kar diya ab hamari Bari.