Logo 
Search:

C++ Programming Forum

Ask Question   UnAnswered
Home » Forum » C++ Programming       RSS Feeds

output using for loop

  Asked By: Newborn    Date: Sep 27    Category: C++ Programming    Views: 1508
  

write a program to print the following output using for loops
1
22
333
4444
55555
........

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Abhishek Singh     Answered On: May 22

public class Project1
{
public static void main (String[] args)
{

int c, d, e;
for (c = 1 ; c <= 8 ; c++)
{
for (d = 1 ; d <= c ; d++)
{
System.out.print ("c");
}
System.out.println("");


}
}

 
Didn't find what you were looking for? Find more on output using for loop Or get search suggestion and latest updates.




Tagged: