Pattern 1:- 1 1 1 1 12 2 2 23 3 34 45 Program:- Output Screenshot:- Pattern 2:- 543215432543545 Program:- Output Screenshot:- Pattern 3:- Program:- Pattern 4:- 555554444333221 Program:- Output Screenshot:- Pattern 5:- 4 4 4 43 3 32 21 Program:- Output Screenshot:- Pattern 6:- 1 2 3 45 6 78 910 Program:- Output Screenshot:-Continue reading “Pattern program in for loop”
Tag Archives: For loop
Pattern Program
Pattern programs are nothing but patterns consisting of numbers, alphabets or symbols in a particular form. These kinds of pattern programs can be solved easily using for loop condition. Program 1:- Output Screenshot:- Program 2:- Output Screenshot:- Program 3:- Output Screenshot:- Program 4:- Output Screenshot:- Program 5:- Output Screenshot:-
LCM in For loop
LCM stands for least common multiple. The least common multiple of two numbers is the smallest number that is a multiple of both of them. Program:- Output Screenshot:-
For loop
A “For” Loop is used to repeat a specific block of code a known number of times. For example, if we want to check the grade of every student in the class, we loop from 1 to that number. When the number of times is not known before hand, we use a “While” loop. InitiateContinue reading “For loop”