write a program to print the following....
plzzzzz ans fast....TEST ...
Attachments:
Answers
Answered by
4
for(I=1;I<5;I++)
cout<<"****"<<endl;
this would do the printing
cout<<"****"<<endl;
this would do the printing
Anonymous:
this is c++ language I think ...
Answered by
4
CODE :
class print_pattern
{
public static void main(String args[])
{
for(int i=1;i<=5;i++)
{
for(int j=1;j<=4;j++)
{
System.out.print("* ");
}
System.out.println();
}
}
}
LOGIC :
➡The number of symbols in a single line is determined by the j-loop
➡The number of lines to be printed depends on i-loop.
➡This is the reason why I gave j-loop 4 times and i-loop 5 times .
➡After the j-loop , we need to go to the next line hence the statement : "System.out.println()" .
Similar questions
Science,
6 months ago
Science,
6 months ago
English,
6 months ago
CBSE BOARD X,
1 year ago
Business Studies,
1 year ago