0% found this document useful (0 votes)
25 views1 page

Are A of A Rectangle

The program asks the user to input the length and width of a rectangle, calculates the area by multiplying length and width, calculates the perimeter by adding the length and width and multiplying by 2, and prints both results.

Uploaded by

Richard Legaspi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Are A of A Rectangle

The program asks the user to input the length and width of a rectangle, calculates the area by multiplying length and width, calculates the perimeter by adding the length and width and multiplying by 2, and prints both results.

Uploaded by

Richard Legaspi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <stdio.

h>
#include <stdlib.h>

int main(){

float length,width,area,perimeter;
int multiplier = 2;
//My very own code :) Richard Legaspi
printf("Enter the length:\t");
scanf("%f", &length);
printf("Enter the width:\t");
scanf("%f", &width);

area = length * width;


printf("Area=%.6f\n", area);
perimeter = (length + width) * multiplier;

printf("Perimeter=%.6f\n", perimeter);

return 0;

You might also like