+ 6
Need help
I want to make this 1 10 101 but couldn't check the error here is my code plz help me correct https://code.sololearn.com/c498R3e0YWje/?ref=app
7 Respostas
+ 10
No error just replace b by 0 and a by 1 in system.out.print
+ 11
// next time, please indent your code for the love of cookies.
public class NumberPattern
{
public static void main(String[] args)
{
for (int a = 1; a <= 5; a++)
{
for (int b = 1; b <= a; b++)
{
if(b%2 == 0)
{
System.out.print(0);
}
else
{
System.out.print(1);
}
}
System.out.println();
}
}
}
+ 8
The question itself is confusing.
Like give more examples like
1
10
101
1010
10101
101010
1010101
Because we need to know the patter. Your quedtion can also suggest:
1
10
101
1011
10111
101111
1011111
+ 7
Nice!
The second one is easy too.
(won't do as I am really bad at Java)
+ 3
got it
+ 1
$ vengat that's fist one but u got me another idea to try for otherone
+ 1
as I am đđđ