int main() // your program will be executed line by line after int main()
printf("\n Enter any Number:"); // printf means show me in screen what i wrote between ""
symbol \n means -> change line
scanf("%d", &num); // scanf used to set something in a variable
%d means system is waitting an integer,
&num is where the thing that you will insert from keyboar will be put in variable named num (example if you press 5 and enter the variable num will become 5)
printf("Multiplication table of %d: \n", num); // As we said it will show us what is in "" and it will show us in screen:
--> Multiplication table of %d
BUT %d WILL BE REPLACEd BY THE thing THAT YOU ENTERED AT SCANF (If you added 5 and then clicked enter the message will be: )
--> Multiplication table of 5
Then
while (i <= 10) { // while variable i < or = 10 do what is between brackets
printf("\n %d x %d = %d", num, i, num * i);
i++; // this means i+1
}
so it check if i(which is 1 as is set at the begin) is <= 10
printf -> show at screen -> 5(num of var num) x 1(num of var i) = 5 (num * i)
i++ background sets i+1 so i becomes 2
then it checks if i(which is now 2) is <= 10
printf -> show at screen ---> 5 x 2 = 10
i++ background sets i+1 so i becomes 2
the shame again and again
when i becomes 9 it is <10 and when i is 10 it is = 10 so it will keep doing
then when i become 11 it will end
so the one that wrote the code wanted to show the first 10 multiplications of the number that will be given by the user
in our example it will show us in screen:
1 x 5 = 5
2 x 5 = 10
3 x 5 = 15
4 x 5 = 20
5 x 5 = 25
6 x 5 = 30
7 x 5 = 35
8 x 5 = 40
9 x 5 = 45
10 x 5 = 50
I hope my post is useful and well written.