Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Sichere ProgrammierungBreeze TTS 2 vs ElevenLabs: Open Source TTS Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungAgentic AI vs Generative AI: The 2026 Verdict(23.09.2026 um 05:44 Uhr)
Sichere ProgrammierungI made my agent prove every quote against the source document(23.09.2026 um 05:45 Uhr)
Sichere Programmierung8mb.video Alternative: Skip the Line, Skip the Upsell(23.09.2026 um 05:47 Uhr)
Sichere ProgrammierungBuilding a GTA 6 JSON API for entities and current status(23.09.2026 um 05:52 Uhr)
Sichere ProgrammierungEvery filter needs a documented exception(23.09.2026 um 06:01 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

For loop - Alphabet pattern printing

Program 1: package Forloop; public class PatternV { public static void main(String[] args) { patternV(); } private static void patternV() { for (int line=1;…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!




Program 1:






package Forloop;

public class PatternV
{
public static void main(String[] args)
{
patternV();

}

private static void patternV()
{
for (int line=1; line<=9;line++)
{
for(int col=1; col<=9; col++)
{
if((line==col || line+col==10) && line<=5)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println();
}

}
}


------------------------------------------------------------------
OUTPUT:

* *
* *
* *
* *
*









Program 2:






package Forloop;

public class PatternI
{

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

}

private static void patterni()
{
for (int line=1; line<=9;line++)
{
for(int col=1; col<=9; col++)
{
if (line==1 || col==5 || line==9)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println();
}
}

}

--------------------------------------------------------------------
OUTPUT:

* * * * * * * * *
*
*
*
*
*
*
*
* * * * * * * * *










Program 3:






package Forloop;

public class PatternM
{

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


}
private static void patternM()
{

int line;
for ( line=1; line<=9;line++)
{
for (int col=1; col<=9;col++)
{
if (col==1 || col==9)
System.out.print("* ");
else if((line==col || line+col==10)&&line<=5)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println();
}

}

}


--------------------------------------------------------------------
OUTPUT:

* *
* * * *
* * * *
* * * *
* * *
* *
* *
* *
* *










Program 4:






package Forloop;

public class PatternA
{

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

}

private static void patternA()
{
for (int line=1; line<=9;line++)
{
for(int col=1; col<=9; col++)
{
if((line==col || line+col==10) && 5<=line)
System.out.print("* ");
else if( (line==7 ||col==3||col==4|| col==5)&& 7==line)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println();
}

}

}
--------------------------------------------------------------------
OUTPUT:

*
* *
* * * * * * * * *
* *
* *










Program 5:






package Forloop;

public class PatternL
{

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

}

private static void patternL()
{
int line;
for ( line=1; line<=9;line++)
{
for (int col=1; col<=9;col++)
{
if (col==1 || line==9)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println();
}
}

}
--------------------------------------------------------------------
OUTPUT:

*
*
*
*
*
*
*
*
* * * * * * * * *










Program 6:






package Forloop;

public class PatternD {

public static void main(String[] args)
{
patternD();
}

private static void patternD()
{
for (int line=1; line<=10;line++)
{
for(int col=1; col<=10; col++)
{
if(col==3||col==10)
System.out.print("* ");
else if(line==10 || line==1)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println(" ");
}

}

}
--------------------------------------------------------------------
OUTPUT:

* * * * * * * * * *
* *
* *
* *
* *
* *
* *
* *
* *
* * * * * * * * * *










Program 7:






package Forloop;

public class PatternE {

public static void main(String[] args)
{
patternE();
patternV();
patterni();

}

private static void patterni()
{
for (int line=1; line<=9;line++)
{
for(int col=1; col<=9; col++)
{
if (line==1 || col==5 || line==9)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println();
}
}

private static void patternV()
{
for (int line=1; line<=9;line++)
{
for(int col=1; col<=9; col++)
{
if((line==col || line+col==10) && line<=5)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println();
}

}

private static void patternE()
{

for (int line=1; line<=10;line++)
{
for(int col=1; col<=10; col++)
{
if(line==1||col==1||line==10||line==5)
System.out.print("* ");
}

System.out.println(" ");
}


}

}

--------------------------------------------------------------------
OUTPUT:

* * * * * * * * * *
*
*
*
* * * * * * * * * *
*
*
*
*
* * * * * * * * * *


* *
* *
* *
* *
*


* * * * * * * * *
*
*
*
*
*
*
*
* * * * * * * * *











Program 8:(F)






package Forloop;

public class PatternF {

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

}

private static void patternF()
{

for (int line=1; line<=10;line++)
{
for(int col=1; col<=5; col++)
{
if(line==1||col==1||line==5)
System.out.print("* ");
}

System.out.println(" ");
}
}
}

--------------------------------------------------------------------
OUTPUT:

* * * * *
*
*
*
* * * * *
*
*
*
*
*









Program 9:






package Forloop;

public class Pattern1
{

public static void main(String[] args)
{
pattern1();
pattern2();

}

private static void pattern2()
{
for (int line=1; line<=10;line++)
{
for(int col=1; col<=10; col++)
{
if(col==1||col==10)
System.out.print("* ");
else if(line==col||line+col==10)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println(" ");
}}


private static void pattern1()
{
for (int line=1; line<=10;line++)
{
for(int col=1; col<=10; col++)
{
if(col==1||col==10)
System.out.print("* ");
else if(line==10 || line==1||line==col||line+col==10)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println(" ");
}}

}


--------------------------------------------------------------------
OUTPUT:

* * * * * * * * * *
* * * *
* * * *
* * * *
* * *
* * * *
* * * *
* * * *
* * *
* * * * * * * * * *


* * *
* * * *
* * * *
* * * *
* * *
* * * *
* * * *
* * * *
* * *
* *










Program 10:






package Forloop;

public class Pattern2 {

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

}

private static void pattern2()
{
for (int line=1; line<=10;line++)
{
for(int col=1; col<=10; col++)
{
if(col==5||line==5)
System.out.print("* ");
else if(line==col||line+col==10)
System.out.print("* ");
else
System.out.print(" ");
}

System.out.println(" ");
}}

}


--------------------------------------------------------------------
OUTPUT:

* * *
* * *
* * *
* * *
* * * * * * * * * *
* * *
* * *
* * *
* * *
* *



Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten For loop - Alphabet pattern printing

Thematisch verwandte Begriffe: loop, Alphabet, pattern, printing · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-18163 | IBM Financial Transaction Manager (FTM) for RedHat OpenShift could allow…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick