Thursday, September 23, 2021
Pattern- 8 Star Print
Pattern- 8 Star Print
Logic-
for(int i=1; i<=5; i++)
{
for(int j=2; j<=i; j++)
{
System.out.print(" ");
}
{
for(int k=i; k<=5; k++)
System.out.print("* ");
}
System.out.println( );
}
Program--
* * * * *
* * * *
* * *
* *
*
class Pattern8
{
public static void main(String[] args)
{
for(int i=1; i<=5; i++)
{
for(int j=2; j<=i; j++)
{
System.out.print(" ");
}
{
for(int k=i; k<=5; k++)
System.out.print("* ");
}
System.out.println( );
}
}
}
For Proper Understanding Watch the Video :-
Pattern- 7 star Print Decrement
Pattern- 7 star Print
Logic-
for(int i=1; i<=5; i++)
{
for(int j=i; j<=5; j++)
{
System.out.print("* ");
}
System.out.println( );
}
Program-
For Proper Understanding Watch the Video :-
Pattern- 6 Star Print Increment order
Pattern- 6 Star Print
Logic -
for(int i=1; i<=5; i++)
{
for(int j=1; j<=i; j++)
{
System.out.print("* ");
}
System.out.println( );
}
Program-
Saturday, September 18, 2021
Pattern -5 Number print 1 to 25
Pattern -5
Logic---
int k=1;
for(int i=1; i<=5; i++)
{
for(int j=1; j<=5; ++j)
{
System.out.print(k++ + " ");
}
System.out.println( );
}
Program---
For Proper Understanding Watch the Video :-
Pattern -4 number print 1 0 1 0 1
Pattern -4
Logic---
for(int i=1; i<=5; i++)
{
for(int j=1; j<=5; j++)
{
if(j%2==0)
{
System.out.print("0 ");
}
else
System.out.print("1 ");
}
System.out.println( );
}
Program--
For Proper Understanding Watch the Video :-
Pattern -3 Number print 1 1 1 1 1
Pattern -3
Logic--
Program--
For Proper Understanding Watch the Video :-
Pattern - 2 Number 1 to 5
Pattern - 2
Logic--
for(int i=1; i<=5; i++)
{
for(int j=1; j<=5; j++)
{
System.out.print(j);
}
System.out.println( );
}
Program-
For Proper Understanding Watch the Video :-
Friday, September 17, 2021
Pattern-1 Star Print
Pattern1-
Logic--
Program:-
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
class Pattern1
{
public static void main(String[] args)
{
for(int i=1; i<=5; i++)
{
for(int j=1; j<=5; j++)
{
System.out.print("* ");
}
System.out.println( );
}
}
}
For Proper Understanding Watch the Video :-
Thursday, September 16, 2021
Magic Number in Java
Program to Check If a Number is Magic number or not
Steps--
Program :-
For Proper Understanding Watch the Video :-
Wednesday, September 15, 2021
Harshad Number
Program to Check If a Number is Harshad number or not.
Harshad Number CodeWithVed
Steps:-
Program:-
For Proper Understanding Watch the Video :-
Buzz Number
Program to Check If a Number is Buzz number or not
Buzz Number CodeWithVed |
Steps:-
Program:-
class Buzz
{
public static void main(String[] args)
{
System.out.println("Enter the value");
int n1=new java.util.Scanner(System.in).nextInt();
int num;
num=n1;
if (num % 10 == 7 || num % 7 == 0)
{
System.out.println(n1 + " is a Buzz number ");
}
else
{
System.out.println(n1 + " is a not Buzz number");
}
}
}
For Proper Understanding Watch the Video :-
Pattern- 9 Star Pattern
Pattern- 9 Star Pattern Logic- for(int i=1; i<=5; i++) { ...
-
Pattern -4 Logic--- for(int i=1; i<=5; i++) { for(int j=1; j<=5; j++) ...