Computer Science, asked by anindyaadhikari13, 10 months ago

Challenge to Programmers.

Write a program in Java to display the following pattern upto

1 0 1 0 1 0
1 0 2 0 3 0
1 0 1 0 1 0

Restrictions:-
1. Not to use more than 2 loops.
2. Not to use more than 1 if-else statements.
3. Switch case statements and ternary Operators are not allowed.
3. Maximum Number of Variables that can be used:- 7.


Input:-
Enter the number of rows: 3
Output:-
1 0 1 0 1 0
1 0 2 0 3 0
1 0 1 0 1 0
2nd Run.
Input:-
Enter the number of rows: 4
Output:-
1 0 1 0 1 0 1 0
1 0 2 0 3 0 4 0
1 0 1 0 1 0 1 0
1 0 2 0 3 0 4 0



Solve this if you can.
All the best. ✅✅


Spammers please maintain social distance.​

Answers

Answered by BrainlyProgrammer
1

Question:

  • Write a program in Java to display the following pattern upto

    1 0 1 0 1 0

    1 0 2 0 3 0

    1 0 1 0 1 0

Answer:

Answer is in the attachment

Restrictions Check:-

  1. No. of Loops used:2
  2. No. of if-else:1
  3. Switch or ternary statements used:No
  4. No. of Variables used:4

Thank You For Asking this question

Attachments:
Answered by Itzpurplecandy
0

Answer:

Healthy mind lives in a healthy body. This is a proverb which everyone must have heard or read. But very few pay attention to it. A study was conducted on obesity and many related diseases were found among teenagers. Obesity specifically refers to an excess amount of body fat. This is due to the sedentary lifestyle found between the age of 8-24.

These adolescents are generally found sitting and watching TV programmes. They do not go outside for any physical game. They are found using public transport to school instead of going by bicycle or on foot. Today, children are fond of eating junk food and drinking aerated drinks which contain too much calories and are harmful for growing children. Such children later become prone to many diseases like diabetes, heart diseases, high blood pressure and stroke. It is a health hazard. It is also linked to higher rates of certain types of cancer. Not only this, obesity makes us unattractive

Explanation:

hi

have a nice day ✌️✌️

Similar questions