You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
540 B
C
29 lines
540 B
C
/*--
|
|
|
|
********
|
|
* *
|
|
* *
|
|
********
|
|
|
|
--*/
|
|
#include<stdio.h>
|
|
void main()
|
|
{
|
|
int cols,rows,r,c,s;
|
|
printf("Enter no. of columns: ");
|
|
scanf("%d", &cols);
|
|
printf("Enter no. of rows: ");
|
|
scanf("%d", &rows);
|
|
for(r=1; r<=cols; r++)
|
|
printf("*");
|
|
printf("\n");
|
|
for(c=1; c<=rows-2; c++)
|
|
{
|
|
printf("*");
|
|
for(s=1; s<=cols-2; s++)
|
|
printf(" ");
|
|
printf("*\n");
|
|
}
|
|
for(r=1; r<=cols; r++)
|
|
printf("*");
|
|
} |