Postlab04_Task1_rfelde

Postlab04_Task1_rfelde - program factorial implicit none !...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
! Lab #4: Loops ! File: Postlab04_Task1_rfelde.f95 ! Date: 04 February 2008 ! By: Ryan Robert Felde ! rfelde ! Section: 02/01, 11:30, and ENAD 138 ! Team: 16 ! ! ELECTRONIC SIGNATURE ! Ryan Robert Felde ! ! The electronic signature above indicates the program submitted for ! evaluation is my individual work and I have a general understanding ! of all aspects of its development and execution. ! ! A BRIEF DESCRIPTION OF WHAT THE PROGRAM OR FUNCTION DOES ! This program asks a user for an upper bound of the numbers for which they want to calculate the factorial. It then ! calculates every even factorial up to the number that was input.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: program factorial implicit none ! Initialize variables Integer :: Num, Fact Integer :: Index_1, Index_2 ! Prompt for input and read the value in as Num write(*,*)'Enter upper bound for factorials: ' read(*,*) Num ! Set Index_1 equal to the even numbers between 0 and the number entered do Index_1 = 0, Num, 2 !Initialize the integer value for which you will multiply by Fact = 1 ! Calculate the factorials of the even numbers do Index_2 = 1, Index_1 Fact = Fact * Index_2 end do ! Output the results of the calculations write(*,*)Index_1, ' ! = ', Fact end do stop end...
View Full Document

Ask a homework question - tutors are online