write a computer program to display the following pattern. 1 2 3 4 5. 6 7 8 9.
Answers
Answered by
1
Answer:
def abc():
print("1 2 3 4 5. 6 7 8 9.)
abc()
Answered by
1
Answer:
#include<stdio.h>
#include<conio.h>
int main()
{
int i, j, k, count=1;
//for loop for all the rows=4
for(i=1;i<=4;i++)
{
//add left space for pattern
for(j=1;j<=4-i;j++)
{
printf("*");
}
//add element after space
for(k=1;k<=i;k++)
{
printf(" %d",count);
count++;
}
printf("\n");
}
}
Similar questions
Math,
2 months ago
Science,
2 months ago
Hindi,
6 months ago
Social Sciences,
6 months ago
Geography,
11 months ago
Social Sciences,
11 months ago
English,
11 months ago