Tuesday, March 31, 2015

Write a Fortran program & Find the area of the triangle


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
!Author:Md. Abde Mannaf
!The program finds area of the triangle read side
program area_triangle
    implicit none
    integer::a,b,c
    real::area,s,sqrt
    print*,'enter the value of three sides of triangle  a,b,c'
    read*,a,b,c
    if(a+b>c .and. b+c>a .and. c+a>b) then
        s=(a+b+c)/2
        area=sqrt(s*(s-a)*(s-b)*(s-c))
        print*,'area of triangle =',area
    else
        print*,'input value is not valid'
    end if
end program area_triangle

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

Finds Area of a Circle

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
!write a FORTRAN program that reads a radius of a circle & print its area
!The program finds area of a circle
program area_circle
    implicit none
    real, parameter::pi=3.1416
    real::area,r
    print*,'Enter the value of radius='
    read*,r
    area=pi*r**2
    print*,'Area of the circle=',area
end program area_circle

শুরু হল FORTRAN প্রোগ্রামিং



ফরট্রান প্রোগ্রাম করতে হলে প্রথমে জানতে হবে এর সিনট্যাক্স সম্পর্কে।

কোনটা দারা কি কাজ হয় এই সম্পর্কে যদি ভাল জ্ঞান থাকে তাহলে প্রোগ্রাম করা সহজ হয়। আমরা এই পর্বে কিছু সিনট্যাক্স সম্পর্কে জানব।

যেমনঃ

Monday, March 23, 2015

First program


1
2
3
4
5
6
7
!author:Md. Abde Mannaf
!The is first program
program first
    implicit none
      এখেনে প্রোগ্রাম লিখতে হবে। 
      print*,'hello world'
end program first