This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: printf( &quot;Please enter the length and width of a rectangule(use space between data): &quot; ); /*scan both length and width at the same time*/ scanf( &quot;%d%d&quot; ,&amp;length,&amp;width); /*claculate are and perimeter*/ area=length*width; perimeter=2*(length+width); /*display both results at the same time*/ printf( &quot;The area is %d and the perimeter is %d\n&quot; ,area,perimeter); return 0; } RESULT: Please enter the length and width of a rectangule(use space between data): 3 5 The area is 15 and the perimeter is 16 Press any key to continue . . ....
View Full Document
This note was uploaded on 09/04/2011 for the course EE 140 taught by Professor Lanxiang during the Spring '11 term at Montgomery College.
- Spring '11