How to display 1*1 11*11 using c program?

[Closed]
Report
Posts
3
Registration date
Tuesday August 31, 2010
Status
Member
Last seen
August 31, 2010
-
Posts
6428
Registration date
Sunday June 6, 2010
Status
Moderator
Last seen
July 16, 2020
-
Hello,

i need answer urgent please help me

3 replies

Posts
6428
Registration date
Sunday June 6, 2010
Status
Moderator
Last seen
July 16, 2020

Hello,
Explain it clearly. Let me know the output that should appear. I will try my best.
Posts
3
Registration date
Tuesday August 31, 2010
Status
Member
Last seen
August 31, 2010

how to display the output 1*1 11*11 111*111 1111*1111 using c program?
Posts
6428
Registration date
Sunday June 6, 2010
Status
Moderator
Last seen
July 16, 2020

Hello,

Try this 1.

#include<stdio.h>
#include<conio.h>
main()
{
int i,j,n;
clrscr();
printf("Enter the number of rows=");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
lh(i);
printf("*");
rh(i);
printf("\n");
}
getch();
}

lh(int k)
{
int i;
for(i=1;i<=k;i++)
printf("1");
}
rh(int k)
{
int i;
for(i=1;i<=k;i++)
printf("1");
}

I just tried my best.

Good Luck.