Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Fortran Arithmetic Operators

program arithmeticOp

! this program performs arithmetic calculation
implicit none  

   ! variable declaration
   integer :: a, b, c
   
   ! assigning values 
   a = 5   
   b = 3  
   
   ! Exponentiation 
   c = a ** b 
   
   ! output 
   print *, "c = ", c
   
   ! Multiplication  
   c = a * b 
   
   ! output 
   print *, "c = ", c
   
   ! Division  
   c = a / b 
   
   ! output 
   print *, "c = ", c
   
   ! Addition
   c = a + b 
   
   ! output 
   print *, "c = ", c
   
   ! Subtraction 
   c = a - b 
   
   ! output 
   print *, "c = ", c
   
end program arithmeticOp

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.