C++ FOR BEGINNERS (2025) - What is nested for loop, How to Multiplication table PROGRAMMING TUTORIAL

preview_player
Показать описание
What is nested for loop and how is it used?
In this video I'll explain how and when is nested for loop used on an example of a multiplication table.

📚 Learn how to solve problems and build projects with these Free E-Books ⬇️

Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.

Related videos:

Follow me on other platforms:

*******CODE IS IN THE COMMENTS*******
Рекомендации по теме
Комментарии
Автор

📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
Experience the power of practical learning, gain career-ready skills, and start building real applications!
This is a step-by-step course designed to take you from beginner to expert in no time!
💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
Use it quickly, because it will be available for a limited time.

#include <iostream>
using namespace std;

void main()
{
//Multiplication table

for (int i = 1; i <= 10; i++) {
for (int j = 1; j <= 10; j++) {
cout << i << " * " << j << " = " << i + j << endl;
}
cout << endl;
}

system("pause>0");
}

CodeBeauty
Автор

I was watching this video as normal but The ending blew up my mind of how we can solve a huge problem from a small piece of code. I really like how you explained the concept.

fnuhasham
Автор

Such a teacher! I am really amazed by the way of explaining complicated subjects and making them so easy to understand. It is very nice to see an intelligent woman with the sense of humour. I would like to thank you so so much.

merveakbudak
Автор

Thank you so much. now I know the flow of nested loops.

hurleybanaag
Автор

This really made me understand the nested for loop..You're Amazing Saldina😍😍

tebellosephofane
Автор

I love how relax you are , and how it was easy to explain it

yaserabd
Автор

Outstanding tutorial, thanks to you nested loop is easily understandable

androvictrayo-dyeh
Автор

Nice video, thank you for being very thorough. Much appreciated :)

Flavzz
Автор

Using multiplication table to explain really help

kelvins
Автор

You are so cool. After your video, its seems like programming is easy, if we do it calmly. Thank you! Subscribed you!

ayeshakhadim
Автор

Thank you for you to complete my exercises

ព្រុំដែនញូ
Автор

It help me so much very different from html . thank you

davidalvarado
Автор

Why are you using void main(), instead of int main()? I got an error on my compiler saying that it must return int. Can you explain? Thank you!

rudylucas
Автор

4 million is a big number to count to. it took someone 89 days to count to 1 million, 16 hours a day. it could easily take a year to count to 4 million. good stuff.

tomiadventures
Автор

Will you please explain how to print the same tables in horizontal

manoharsagunthalla
Автор

Thank you for the tutorial is very helpful. I understand c++ due to your explication that is very good.

I try to mixt the last two lessons in one program. Thank you for your tutorial. All the best.

#include "pch.h"
#include <iostream>

using namespace std;

int main()
{
cout << " Exercise the multiplication table\n\n";
int i;
do {

cout << " Show the multiplication with ";

cin >> i;

cout << endl;

} while (i > 10);

for (int j = 1; j <= 10; j++)
{
cout << " " << i << " * " << " " << j << " = " << i * j<<endl;
}

cout << endl;




system("pause > 0");
}

traianbadea
Автор

Our teacher, we made j = 11,
How did j return again = 1?

hussinfardan
Автор

*Kada koristimo nested loop racunar prati kod, u našem slučaju dolazi do 1. for loop (uzima vrijednost i=1), zatim ulazi u 2. for loop(uzima vrijednost j=1), pomnoži i ispiše. Nakon toga ne izlazi iz 2. for loop nego samo povećava vrijednost j do one vrijednosti koja je zadata tj. do 10 i tek nakon toga izlazi iz 2. for loop i ponovo se vraća na 1. for loop gdje uzima vrijednost i=2 i tako do kraja.. jesam dobro shvatio?

*Kojim tokom se stvari odvijaju ukoliko imamo npr. 4 for petlje (ugnijezdene) i nakon sto se 4. petlja zavrsi, da li racunar cita kod onda od 1. petlje pa sve ponovo ili prednost ima 3. petlja jer je ona najbliza posljednjoj tj. 4.

Nadam se da ste shvatili haha . LP

Ace-cqjl
Автор

How can I develop the same program that asks the user to give me only even numbers?

bananmuhammed
Автор

Hello I am trying to create this one program that's like a store but I am having trouble in line 137 were I have put a while loop that pretty much a lows a customer to edit the amount of the item he wants but I cant seem to figure out hot to end the loop because after they don't want to edit anything anymore I thought I could just change the variable so the loop becomes false and it goes to the else statement but it doesn't work, if you have time for this I would appreciated and if you dont have time i understand.(I will put the whole block of code)

#include <iostream>
using namespace std;
int main()
{
float cookies = 1.50, chocolate = 1.00, milk = 4.50, ruffles = 1.99, cheetos = 1.50, doritos = 2.10, eggs = 4.75, beans = 1.50,
chicken = 4.99, groundbeef = 4.70, cereal = 3.50, banana = .57, apples = .60, oranges = .66, bread = 1.50, ham = 3.50,
mayonnaise = 3.25, americancheese = 1.50, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16,
c17, c18, total, amount, amount1, amount2, amount3, amount4, amount5, amount6, amount7, amount8, amount9, amount10, amount11
, amount12, amount13, amount14, amount15, amount16, amount17, amount18;

cout << "Amount of cookies($1.50): ";
cin >> amount;
cout << cookies * amount;
system("cls");
cout << "Amount of chocolate($1.00): ";
cin >> amount1;
cout << chocolate * amount1;
system("cls");
cout << "Amount of milk($4.50): ";
cin >> amount2;
cout << milk * amount2;
system("cls");
cout << "Amount of ruffles($1.99): ";
cin >> amount3;
cout << ruffles * amount3;
system("cls");
cout << "Amount of cheetos($1.50): ";
cin >> amount4;
cout << cheetos * amount4;
system("cls");
cout << "Amount of doritos($2.10): ";
cin >> amount5;
cout << doritos * amount5;
system("cls");
cout << "Amount of eggs($4.75): ";
cin >> amount6;
cout << eggs * amount6;
system("cls");
cout << "Amount of beans($1.50): ";
cin >> amount7;
cout << beans * amount7;
system("cls");
cout << "Amount of chicken($4.99): ";
cin >> amount8;
cout << chicken * amount8;
system("cls");
cout << "Amount of groundbeef($4.70): ";
cin >> amount9;
cout << groundbeef * amount9;
system("cls");
cout << "Amount of cereal($3.50): ";
cin >> amount10;
cout << cereal * amount10;
system("cls");
cout << "Amount of bennas($.57): ";
cin >> amount11;
cout << banana * amount11;
system("cls");
cout << "Amount of apples($.60): ";
cin >> amount12;
cout << apples * amount12;
system("cls");
cout << "Amount of oranges($.66): ";
cin >> amount13;
cout << oranges * amount13;
system("cls");
cout << "Amount of bread($1.50): ";
cin >> amount14;
cout << bread * amount14;
system("cls");
cout << "Amount of ham($3.50): ";
cin >> amount15;
cout << ham * amount15;
system("cls");
cout << "Amount of mayonnaise($3.25): ";
cin >> amount16;
cout << mayonnaise * amount16;
system("cls");
cout << "Amount of americancheese($1.50): ";
cin >> amount17;
cout << americancheese * amount17;
system("cls");


c1 = cookies * amount;
c2 = chocolate * amount1;
c3 = milk * amount2;
c4 = ruffles * amount3;
c5 = cheetos * amount4;
c6 = doritos * amount5;
c7 = eggs * amount6;
c8 = beans * amount7;
c9 = chicken * amount8;
c10 = groundbeef * amount9;
c11 = cereal * amount10;
c12 = banana * amount11;
c13 = apples * amount12;
c14 = oranges * amount13;
c15 = bread * amount14;
c16 = ham * amount15;
c17 = mayonnaise * amount16;
c18 = americancheese * amount17;

cout << "cookies: " << amount << endl;
cout << "chocolate: " << amount1 << endl;
cout << "milk " << amount2 << endl;
cout << "ruffles: " << amount3 << endl;
cout << "cheetos: " << amount4 << endl;
cout << "doritos: " << amount5 << endl;
cout << "eggs: " << amount6 << endl;
cout << "beans: " << amount7 << endl;
cout << "chicken: " << amount8 << endl;
cout << "groundbeef: " << amount9 << endl;
cout << "cereal: " << amount10 << endl;
cout << "banana: " << amount11 << endl;
cout << "apples: " << amount12 << endl;
cout << "oranges: " << amount13 << endl;
cout << "bread: " << amount14 << endl;
cout << "ham: " << amount15 << endl;
cout << "mayonnaise: " << amount16 << endl;
cout << "americancheese: " << amount17 << endl;


total = c1 + c2 + c3 + c4 + c5 + c6 + c7 + c8 + c9 + c10 + c11 + c12 + c13 + c14 + c15 + c16 + c17 + c18;
cout << "Total: $" << total;

DavidLopez-vkgg
visit shbcf.ru