Question

In: Computer Science

Write FORTRAN 90 statements that will display an appropriate message if an integer variable test is...

Write FORTRAN 90 statements that will display an appropriate message if an integer variable test is divisible by 2,3, and or 10 using if statements.

Solutions

Expert Solution

program hello
    integer ::test=30
    if(mod(test,2)==0) then
    Print *,test,"is divisible by 2"
    end if
    if(mod(test,3)==0) then
    Print *,test,"is divisible by 3"
    end if
    if(mod(test,10)==0) then
    Print *,test,"is divisible by 10"
    end if
end program hello


Related Solutions

by using Fortran.90 solve the Question below? Q1)Correct the names of the following variable according to...
by using Fortran.90 solve the Question below? Q1)Correct the names of the following variable according to the fortran.90 stander. 1)Max'power, 2) 2*level, 3) low temp,   4) High(speed) Q2)Which of the following are invalid names in Fortran 90 and why? 1)A_HUGE_NUMBER 2)thedate 3)abignumber 4)Program 5)10times 6)Time.minutes 7)HELP!                                                                    1066(8        9)another-number 10)no way 11)f[t] 12)X
Write a fortran 90 program that sets up a 4x4 2D real array A and associate...
Write a fortran 90 program that sets up a 4x4 2D real array A and associate a single value pointer AP with element (2,1) of that array. Set all elements in A equal to 0. and print the value of AP to the screen. Next set all elements in A equal to 1.23 and print the value AP to the screen.
Write a program that accept an integer input from the user and display the least number...
Write a program that accept an integer input from the user and display the least number of combinations of 500s, 100s, 50s, 20s, 10s, 5s, and 1s. Test your solution using this samples] a. Input: 250 Output: 1x200s, 1x50s b. Input: 1127 Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s c. Input: 1127 Output: 5x200s, 1x100s, 1x20s, 1x5s, 2x1s d. Input: 19 Output: 1x10s, 1x5s, 4x1s ​[Hints] o Use division to determine the number of occurrence of each element (i.e. 200, 100)...
How to write a java application that reads an integer, then determines and display whether it's...
How to write a java application that reads an integer, then determines and display whether it's odd or even. Use the remainder operator.
Write a program (fortran 90) that calls a subroutine to approximate the derivative of y=sin(x)+2x^2 using...
Write a program (fortran 90) that calls a subroutine to approximate the derivative of y=sin(x)+2x^2 using a one-sided difference approach fx = (fi-fi-1)/deltaX and a centered difference approach fx = (fi+1-fi-1)/deltaX. The value of the function f and its derivative fx should be evaluated at x=3.75. Your code should print both values tot he screen when it runs.
Write a java script function that accepts integer array as input, and display a new array...
Write a java script function that accepts integer array as input, and display a new array by performing fol lowing modifications, • The values in odd index positions must be incremented by 1 • The values in even index positions must be decremented by 1. • Assume the array index starts from 0. Input 1: arr = [1,2,3,4] Output 1: arr = [0,3,2,5 it done html and javascript and plz do it in simple way
2. For each of the following situations, write down (a) the most appropriate graphical display for...
2. For each of the following situations, write down (a) the most appropriate graphical display for the data, and (b) identify a statistic that you might be interested in regarding the data. (i) [2 marks] A survey given to 400 high school students asked the following question: "How many minutes do you study on a typical weeknight?". (ii) [2 marks] Students in Statistics classes made up of 360 students were asked the main method of transportation to school. Students answers...
In Object Oriented programming C++ : Write the appropriate functions for Student to neatly display a...
In Object Oriented programming C++ : Write the appropriate functions for Student to neatly display a Student, and then finally GPA. Have items neatly line up in columns. I need help creating a derived class called student that finds GPA (between 0.0 and 4.0) and credits completed (between 0 and 199).
With C code Write a switch statement (not a complete program) which prints an appropriate message...
With C code Write a switch statement (not a complete program) which prints an appropriate message for a letter code entered. Use the following messages: If L is entered, output the message "Lakers" If C is entered, output the message "Clippers" If W is entered, output the message "Warriors" If any other character is entered, output the message "invalid code" Make sure to handle the case where the user enters in a small letter. That is, a capital or small...
Using Miller-Rabin primality test algorithm to write a Java program which can test if an integer...
Using Miller-Rabin primality test algorithm to write a Java program which can test if an integer is a prime. The input of the algorithm is a large positive integer. The output is “the number *** is a prime” or “the number *** is not a prime”. The error probability of the algorithm should be no more than 1 256 . Use this program to test some big integers. In Java, there is a class BigInteger. You can use methods of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT