Question

Quincy College CSI 116 91 - Introduction to Programming (Fall 2019) A question 5 [30pts]: The area of a rectangle with sides
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include <stdio.h>

int main(void)
{
//variable declaration
double A, w, h;
//display message
printf("\nEnter the length of first side of the rectangle: ");
//input the length of first side
scanf("%lf", &w);
//display message
printf("\nEnter the length of second side of the rectangle: ");
//input the length of second side
scanf("%lf", &h);
//calculate area of the rectangle
A = w * h;
//display the rectangle area
printf("\nArea of the rectangle is: %.2lf", A);
return 0;
}

Code screenshot:

#include <stdio.h> int main (void) //variable declaration double A, w, h; //display message printf(\nEnter the length of fir

OUTPUT:


Enter the length of first side of the rectangle: 12.50

Enter the length of second side of the rectangle: 19.00

Area of the rectangle is: 237.50

Add a comment
Know the answer?
Add Answer to:
Quincy College CSI 116 91 - Introduction to Programming (Fall 2019) A question 5 [30pts]: The...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT