9/8/2023 0 Comments Write a for loop in php![]() ![]() This is how we control our inner loop based on the outer loops control variable. Our outer control variable is i and inner control variable is j.Īnd so on. Since the number of stars in each line is directly dependent on the line number, our inner loop will be a function of the control variable in our outer loop. ![]() Keeping the logic in mind, our outer loop will run five times. 1 star in the first line, 2 stars in the second line and so on. It prints the increasing number of stars in subsequent lines. So, keeping all of this in mind, let’s try to code the patterns now. Also, there is the involvement of spaces and tabs to produce the desired pattern.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |