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 Fortran program that prompts the user for an integer appreciate among 1 and 10, implied. Use a loop (your select of which bark) to print extinguished whole of the integers among 1 and 100, implied, that are equal multiples of that enumerate.

    Expert Confutation

     

    program hello

    ! inspect the integer

    read(*,*) n

     

    ! control if enumerate is in the stroll 1 to 10

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

    ! extend loop from 1 to 100

    do 10 i = 2, 100, 2

    ! if n * i is hither than 100, then print the appreciate

    IF(* n <= 100) THEN

    print*, (i*n)

    END IF

    10 continue

    ! if n is referable in the stroll from 1 to 10

    ELSE

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

    END IF

    end program Hello

    Sample Extinguishedput:

    For n = 5