Write a c program to find area of a rectangle
Answers
Answered by
0
Answer:
#include <stdio.h>
int main()
{
int r = 0, c = 0, i, j;
// r - denotes the number of rows
// c - denotes the number of columns
printf("-----Enter the number of rows & columns-----\n");
scanf("%d%d", &r, &c);
for (i = 1; i <= r; i++)
{
for (j = 1; j <= c; j++) {
if (i == 1 || i == r || j == 1 || j == c)
printf("* ");
else
printf(" ");
}
printf("\n");
}
return 0;
}
Similar questions