Wednesday, March 25, 2015

area and perimeter of a rectangle


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
!The program finds area and perimeter of a rectangle
!Using an input system
program area_perimeter
    implicit none
    integer::p,q,area,perimeter
    print*,"Enter the value of p & q"
    print*,"Use comma or blank space to separate value"
    read*,p,q
    area=p*q;
    perimeter=2*(p+q);
    print*,"area is=",area, "perimeter is=",perimeter
end program area_perimeter

1 comment: