answersLogoWhite

0


Best Answer

The solution is two use a nested for loop:

int startingNum = 1;

int maxNum = 10;

for(int currentNum = startingNum; currentNum <= maxNum; currentNum++)

{

for(int j = 0; j < currentNum; j++)

{

printf("%d", currentNum);

}

printf("\n");

}

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

#include
#define N 9
//Replace 9 with however high you want it to count
int main()
{
int i, j;
for(i=1;i<=N;i++)
{
for(j=0;j{
printf("%d",i);
}
printf("\n");
}
return 0;
}

This answer is:
User Avatar

User Avatar

Wiki User

7y ago

int x = 0;

while (x++<5) {

for (int i=0; i<x; ++i) printf ("%d", x);

printf("\n");

} // end while

Output:

1

22

333

4444

55555

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

#include<stdio.h>

#include<conio.h>

void main()

{

int n,i,j;

clrscr();

printf("enter the last limit:");

scanf("%d",&n);

for(i=1;i<=n;i++)

{

for(j=1;j<=i;j++)

{

printf("%d",i);

}

}

getch();

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How would you write a c program using nested loop that output the values are 1 22 333 4444 55555?
Write your answer...
Submit
Still have questions?
magnify glass
imp