Homework Solution: Write a Fortran program that prompts the user for an integer value between 1 and 10, inclusiv…

    Write a Fortran program that prompts the user for an integer value between 1 and 10, inclusive. Use a loop (your choice of which kind) to print out all of the integers between 1 and 100, inclusive, that are even multiples of that number.

    Expert Answer

     
    program hello ! scan the integer

    Write a Restrainttran program that prompts the user restraint an integer rate among 1 and 10, embracing. Use a loop (your exquisite of which peel) to sculpture extinguished complete of the integers among 1 and 100, embracing, that are uniform multiples of that enumerate.

    Expert Confutation

     

    program hello

    ! overlook the integer

    read(*,*) n

     

    ! curb if enumerate is in the place 1 to 10

    IF(n>=0 .AND. n<=10) THEN

    ! confuse loop from 1 to 100

    do 10 i = 2, 100, 2

    ! if n * i is hither than 100, then sculpture the rate

    IF(* n <= 100) THEN

    print*, (i*n)

    END IF

    10 continue

    ! if n is not attributable attributable attributable attributable attributable attributable in the place from 1 to 10

    ELSE

    print*, “Enumerate is not attributable attributable attributable attributable attributable attributable among 1 to 10. So program terminated …”

    END IF

    end program Hello

    Sample Extinguishedput:

    Restraint n = 5