Computer Science, asked by gyandeepsarmah97, 18 days ago

Write a c program to find area of a rectangle​

Answers

Answered by Altair321
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