Question
if (start_temp 200 .or. j>(stop_temp-start_temp)) then do print*, Invalid Value Type the difference read*, j if (start_temp>-10 .or. stop_temp <200 .or. j>(stop_temp-start_temp)) exit !If user
if (start_temp<-10 .or. stop_temp>200 .or. j>(stop_temp-start_temp)) then do print*, "Invalid Value Type the difference" read*, j if (start_temp>-10 .or. stop_temp<200 .or. j>(stop_temp-start_temp)) exit !If user entered the correct input then the program exit. end do end if ! allocate memory to temp_array allocate ( temp_array(((stop_temp-start_temp)/j)+1,3) ) write(*,*) '| ','Centigrate','()','|',' ', 'Fahrenhite','()' ,'|','Kelvin','()', '|' k1=1 do i = start_temp, stop_temp, +j Fahrenheit= (32.0+i*1.8) Kelvin=i+273.15 ! Put values in Array temp_array(k1,1)=i temp_array(k1,2)= Fahrenheit temp_array(k1,3)=Kelvin k1=k1+1 end do k1=1 ! To print values from Array do while(k1<=((stop_temp-start_temp)/j)+1) write(*,*) '| ',temp_array(k1,1),'|',' ', temp_array(k1,2) ,'|',temp_array(k1,3), '|' k1=k1+1 end do ! To display size of Array write(*,*) 'Size of Matrix',size(temp_array) deallocate (temp_array) end program
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started