This preview shows pages 1–2. Sign up to view the full content.
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
- Spring '11