answersLogoWhite

0

Commented code for a win32 console application:

#include //Include stdio.h for console input/output funcs

#include //Include conio.h for getch function (lol)

void main( )

{

int nWidth, nHeight; //Variables to hold width and height of rectangle

while( 1 ) //Infinite loop - can only be exited using "break;" (among others)

{

printf( "Enter rectangle width: " ); //Print text...

scanf( "%d", nWidth ); //Scan for user input

fflush( stdin ); //Flush user input

printf( "Enter rectangle height: " ); //Print text...

scanf( "%d", nHeight ); //Scan for user input

fflush( stdin ); //Flush user input

printf( "Area of rectangle with width of %d and height of %d is %d\n", nWidth, nHeight, nWidth*nHeight ); //Print text...

fflush( stdout ); //Flush output

//Now program will jump back to start of loop

}

}

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is the area of a rectangle is the length is 16 and the primeter is 56?

The area of rectangle is : 896.0


The length of a rectangle is 3 inches greater than the width Write a polynomial that represents the area of the rectangle?

let x be the width let x+3 be the length The area of a rectangle is length X width Area=(x)(x+3) =x^2+3x


The width of a rectangle is 61 cm and its length is 71 cm Write the ratio of its width to its length as a fraction?

61:71 1:71/61


Write a program to accept length and breadth of a rectangle and then calculate its area and print it?

int length int breadth int area= (length x breadth) print area


The length of a rectangle is 13.6cm the perimeter of the rectangle is 37.8cm what is the width?

Write an equation for the perimeter, and solve it. Remember that the perimeter is the sum of all four sides.


If the length of a rectangle is 7 and the width is 9 what two multiplication equations can you write to represent the area of the rectangle?

Area of rectangle: 7 times 9 = 63 square unitsArea of rectangle: 9 times 7 = 63 square units


Write a C program to find the area and perimeter of you square ii rectangle?

#include<stdio.h> void main() { float length, breadth, area, perimeter; printf("Enter the length & breadth of a Rectangle\n(length breadth): "); scanf("%f %f",&length,&breadth); area=length*breadth; perimeter=2*(length+breadth); printf(" Area of the Rectangle=%0.3f\n",area); printf("Perimeter of the Rectangle=%0.3f\n",perimeter); printf("(Press ENTER to exit.)"); getch(); printf("\n"); }


What is x The width and length of a rectangle are given by two consecutive odd integers. Write an expression for the area A of the rectangle. Use x for the shorter side of the rectangle.?

A = x times (x + 2) A = x squared + 2x


Write a program in pascal that calculates the area of a circle?

{Area s the area of cube} {Length is the length of one side of the cube} program AreaofCube; var Area,Length:real; begin write('Enter the length of cube: '); readln(Length); Area:=6*(Length*Length); writeln('The area of cube is ', Area, ' cm^2.'); end.


Write a statement that does not represent a linear function?

The area of a rectangle with a width of x units and a length of (x + 3) units


How do you write an expression for perimeter of a rectangle that's length is 2x-7 width is x and the diagonal is 3x?

6x-14


What is the answer to A rectangle with an area of 24 in.2 has a length of 8 inches and a width of 3 inches. What is the correct way to write the ratio of its width to length?

It's width to length ratio is 3 : 8.