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

Closed
mahee87 Posts 3 Registration date Tuesday August 31, 2010 Status Member Last seen August 31, 2010 - Aug 31, 2010 at 11:00 AM
jack4rall Posts 6428 Registration date Sunday June 6, 2010 Status Moderator Last seen July 16, 2020 - Sep 1, 2010 at 06:46 AM
Hello,

i need answer urgent please help me

3 replies

jack4rall Posts 6428 Registration date Sunday June 6, 2010 Status Moderator Last seen July 16, 2020
Aug 31, 2010 at 06:41 PM
Hello,
Explain it clearly. Let me know the output that should appear. I will try my best.
0
mahee87 Posts 3 Registration date Tuesday August 31, 2010 Status Member Last seen August 31, 2010
Aug 31, 2010 at 08:54 PM
how to display the output 1*1 11*11 111*111 1111*1111 using c program?
0
jack4rall Posts 6428 Registration date Sunday June 6, 2010 Status Moderator Last seen July 16, 2020
Sep 1, 2010 at 06:46 AM
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.
0