create account

Multiplication (or Addition) Table Using a "For Loop" [ENG/PT] by xmauron3

View this thread on: hive.blogpeakd.comecency.com
· @xmauron3 · (edited)
$0.89
Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]
Ladies and Gentelman, 

Today we are going to learn how to create a multiplication (or Addition) table using Java.
First of all, copy the code below on your IntelliJ or paste on ChatGPT, to understand how it works. Usually if you paste a code on the AI, it can simulate if you order in your prompt. Ask it to simulate and run step by step letting you choose everything. That’s how I do to test a code, or game on Chat GPT.

The only reason the code does 1x1, 1x2, up to 1x10 is because the loop that determines the number to be multiplied is inside the first "for loop", which counts up to 10 for the first number to be used in the multiplication, conditioning what is printed to the multiplication (i * a). 


## To create the Addition table:

If I swap (i * a) with (i + a) and just change the X symbol to + in the printed output, I’ll get 1+1=2, and so on. It’s the same logic, but with a different symbol instead of multiplication.

Let me know in the comments if you have any question!

This was another great post by:

# ***@xmauron3***
## ***”The Future is Awesome”***

________________
PORTUGUESE 🇵🇹 PORTUGUÊS 🇧🇷
# Hoje vamos aprender como criar uma tabela de multiplicação (ou adição) usando Java.
O único motivo pelo qual o código faz 1x1, 1x2, até 1x10, é porque o loop que determina o número a ser multiplicado está dentro do primeiro loop for, que conta até 10 para o primeiro número a ser usado na multiplicação, condicionando o que é impresso à multiplicação (i * a). 

Se eu trocar o (i * a) por (i + a) e apenas mudar o símbolo de X para + no que for impresso, eu terei 1+1=2, e assim por diante. É a mesma lógica, mas com outro símbolo no lugar da multiplicação.

![](https://images.ecency.com/DQmc9UYj3a7umz8zYWzTqLKfjBvQ84inDbaRGarejAsf9BM/83caa718_d291_4e96_8cce_b9e5c53e994e.jpg)
-

Vejam isso no exemplo abaixo. Qualquer problema estou a disposição !
Esse foi outro ótimo post por:
# ***@xmauron3***
## ***O Futuro é Incrível”***

<code> import java.sql.SQLOutput;
public class Main {
    public static void main(String[] args) {
// multiplication table
        for (int i = 1; i <= 10; i++) {
            System.out.println("--------------");
            for (int a = 1; a <= 10; a++) {
                System.out.println(i + "+" + a + "=" + (i + a));
            }
        }
    }
} 
</code>
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorxmauron3
permlinkmultiplication-or-addition-table-using
categorycoding
json_metadata"{"app":"ecency/3.2.0-vision","tags":["coding","java","pt","br","learning","ecency"],"format":"markdown+html","description":"Ladies and Gentelman, Today we are going to learn how to create a multiplication (or Addition) table using Java. import java.sql.SQLOutput; public class Main { public static void main(String[] args) {","image":["https://images.ecency.com/DQmc9UYj3a7umz8zYWzTqLKfjBvQ84inDbaRGarejAsf9BM/83caa718_d291_4e96_8cce_b9e5c53e994e.jpg"],"image_ratios":[1.0951585976627713],"content_type":"general","type":"post"}"
created2024-09-03 16:08:18
last_update2024-09-03 16:24:03
depth0
children7
last_payout2024-09-10 16:08:18
cashout_time1969-12-31 23:59:59
total_payout_value0.446 HBD
curator_payout_value0.444 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,317
author_reputation20,850,952,654,220
root_title"Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,806,398
net_rshares3,599,189,921,497
author_curate_reward""
vote details (50)
@hivebuzz ·
Congratulations @xmauron3! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)

<table><tr><td><img src="https://images.hive.blog/60x70/https://hivebuzz.me/@xmauron3/upvotes.png?202409051922"></td><td>You distributed more than 99000 upvotes.<br>Your next target is to reach 100000 upvotes.</td></tr>
</table>

<sub>_You can view your badges on [your board](https://hivebuzz.me/@xmauron3) and compare yourself to others in the [Ranking](https://hivebuzz.me/ranking)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



**Check out our last posts:**
<table><tr><td><a href="/hive-106258/@hivebuzz/hivefest-2024-badge"><img src="https://images.hive.blog/64x128/https://files.peakd.com/file/peakd-hive/hivebuzz/48VEtcvs7eskeM4UMnbMF7M6zWzjp7R3P5s1cmYTXV6ZFuVmrWL16CfUuVt1JcmRox.png"></a></td><td><a href="/hive-106258/@hivebuzz/hivefest-2024-badge">The countdown to HiveFest⁹ is one week away - Join us and get your exclusive badge!</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pum-202408-delegations"><img src="https://images.hive.blog/64x128/https://i.imgur.com/fg8QnBc.png"></a></td><td><a href="/hive-122221/@hivebuzz/pum-202408-delegations">Our Hive Power Delegations to the August PUM Winners</a></td></tr><tr><td><a href="/hive-122221/@hivebuzz/pud-202409-feedback"><img src="https://images.hive.blog/64x128/https://i.imgur.com/zHjYI1k.jpg"></a></td><td><a href="/hive-122221/@hivebuzz/pud-202409-feedback">Feedback from the September Hive Power Up Day</a></td></tr></table>
👍  
properties (23)
authorhivebuzz
permlinknotify-1725564413
categorycoding
json_metadata{"image":["https://hivebuzz.me/notify.t6.png"]}
created2024-09-05 19:26:54
last_update2024-09-05 19:26:54
depth1
children2
last_payout2024-09-12 19:26:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,603
author_reputation370,796,838,319,151
root_title"Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,852,899
net_rshares3,988,709,091
author_curate_reward""
vote details (1)
@xmauron3 ·
$0.32
Nice!
👍  
properties (23)
authorxmauron3
permlinkre-hivebuzz-202499t17262277z
categorycoding
json_metadata{"content_type":"general","type":"comment","tags":["ecency"],"app":"ecency/3.1.6-mobile","format":"markdown+html"}
created2024-09-09 20:26:21
last_update2024-09-09 20:26:21
depth2
children1
last_payout2024-09-16 20:26:21
cashout_time1969-12-31 23:59:59
total_payout_value0.158 HBD
curator_payout_value0.159 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5
author_reputation20,850,952,654,220
root_title"Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,949,988
net_rshares1,174,249,927,710
author_curate_reward""
vote details (1)
@hivebuzz ·
Getting closer to the 100k upvotes. Awesome work @xmauron3<div><a href="https://engage.hivechain.app">![](https://i.imgur.com/XsrNmcl.png)</a></div>
properties (22)
authorhivebuzz
permlinkre-1725942567298
categorycoding
json_metadata{"app":"engage"}
created2024-09-10 04:29:27
last_update2024-09-10 04:29:27
depth3
children0
last_payout2024-09-17 04:29:27
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length148
author_reputation370,796,838,319,151
root_title"Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,955,416
net_rshares0
@perfilbrasil ·
Obrigado por postar
Obrigado por promover a Língua Portuguesa em suas postagens.

Vamos seguir fortalecendo a comunidade lusófona dentro da Hive.<div class='text-right'><sup>Metade das recompensas dessa resposta serão destinadas ao autor do post.</sup></div><hr/><h4><center><a href='https://vote.hive.uno/@perfilbrasil'>Vote no @perfilbrasil para Testemunha Hive.</a></center></h4>
👍  
properties (23)
authorperfilbrasil
permlinkre-multiplication-or-addition-table-using
categorycoding
json_metadata"{"tags": ["pt"], "description": "Obrigado por postar"}"
created2024-09-03 16:15:06
last_update2024-09-03 16:15:06
depth1
children1
last_payout2024-09-10 16:15:06
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length362
author_reputation13,091,361,116,375
root_title"Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]"
beneficiaries
0.
accountxmauron3
weight5,000
max_accepted_payout10.000 HBD
percent_hbd0
post_id136,806,517
net_rshares4,070,939,977
author_curate_reward""
vote details (1)
@xmauron3 ·
$0.32
Valeu!
👍  
properties (23)
authorxmauron3
permlinkre-perfilbrasil-202499t172610550z
categorycoding
json_metadata{"content_type":"general","type":"comment","tags":["pt"],"app":"ecency/3.1.6-mobile","format":"markdown+html"}
created2024-09-09 20:26:12
last_update2024-09-09 20:26:12
depth2
children0
last_payout2024-09-16 20:26:12
cashout_time1969-12-31 23:59:59
total_payout_value0.162 HBD
curator_payout_value0.162 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length6
author_reputation20,850,952,654,220
root_title"Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,949,984
net_rshares1,198,195,430,683
author_curate_reward""
vote details (1)
@riyat ·
$0.25
## Sending love and curation Ecency vote. keep giving the best

Please vote for Ecency proposal👇
https://ecency.com/proposals?filter=team

![](https://images.ecency.com/DQmRgRiR86ER2qWnpJ7UyBGbPZE8rkfc9FT1tiwtvoxw4e9/ecency_spring_divider4.png)

👍  ,
properties (23)
authorriyat
permlinkre-xmauron3-202493t231118682z
categorycoding
json_metadata{"tags":["coding","java","pt","br","learning","ecency"],"app":"ecency/3.2.0-vision","format":"markdown+html"}
created2024-09-03 16:11:18
last_update2024-09-03 16:11:18
depth1
children1
last_payout2024-09-10 16:11:18
cashout_time1969-12-31 23:59:59
total_payout_value0.127 HBD
curator_payout_value0.127 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length246
author_reputation327,361,731,215,206
root_title"Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,806,445
net_rshares1,029,274,797,260
author_curate_reward""
vote details (2)
@xmauron3 ·
$0.31
Thanks!
👍  
properties (23)
authorxmauron3
permlinkre-riyat-202499t172636277z
categorycoding
json_metadata{"content_type":"general","type":"comment","tags":["coding","java","pt","br","learning","ecency"],"app":"ecency/3.1.6-mobile","format":"markdown+html"}
created2024-09-09 20:26:36
last_update2024-09-09 20:26:36
depth2
children0
last_payout2024-09-16 20:26:36
cashout_time1969-12-31 23:59:59
total_payout_value0.156 HBD
curator_payout_value0.156 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length7
author_reputation20,850,952,654,220
root_title"Multiplication (or Addition) Table Using a "For Loop" [ENG/PT]"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id136,949,992
net_rshares1,150,793,037,618
author_curate_reward""
vote details (1)