Write a program to print 1,11,111,1111...nth term
Answers
Answered by
0
Answer:
for(i = 1; i <= n; i++) {
for(j = 1; j <= i; j++) {
printf("1");
}
printf("\n");
}
Explanation:
Assuming you want to print pyramid of 1 starting from 1 element to nth number of elements.
Answered by
0
Answer:IN JAVA
for(i=1;i<=n;i++)//where n=no.oftimes(nth term)
{
for(j=1;j<=I;j++)
{
System.out.print("1");
}
System.out.println(" ");
}
Explanation:
This prog. will print 1 one time, in first turn, 2 times in the next turn, upto n
Sample input: n=5
Sample Output:
1
11
111
1111
11111
Mark it as the Brainliest if you think it is.
Similar questions