0
[SOLVED] Fahrenheit to Celsius Table in JAVA
Given three values - Start Fahrenheit Value (S), End Fahrenheit value (E) and Step Size (W), you need to convert all Fahrenheit values from Start to End at the gap of W, into their corresponding Celsius values and print the table. INPUT FORMAT 3 integers - S, E and W respectively separated by space. OUTPUT FORMAT Fahrenheit to Celsius conversion table. One line for every Fahrenheit and corresponding Celsius value. On Fahrenheit value and its corresponding Celsius value should be separated by tab ("\t") Sample IN====> 0 100 20 //(S E W) OUT====> 0 -17 20 -6 40 4 60 15 80 26 100 37
7 Réponses
- 2
don't worry i figured it out
https://code.sololearn.com/cj1J3YdP4Hz3
+ 1
Here's the code for this question
#include<iostream>
using namespace std;
int main()
{
int s,e,w,i,cd;
cin>>s;
cin>>e;
cin>>w;
for(i=s;i<=e;i+=w)
{
cd=(i-32)/1.8;
cout<<i<<"\t"<<cd<<"\n";
}
}
0
Where is your code?
0
code??
0
start = int(input())
end = int(input())
step = int(input())
curr_temp = start
while curr_temp <= end:
c = 5/9 * (curr_temp-32)
print(curr_temp, " ", int(c))
curr_temp = curr_temp+step
0
def printTable(s, e, w):
# Implement Your Code Here
while True:
c = 0
if s <= e:
c = (s - 32) * 5 / 9
print(s, int(c))
s = s + w
else:
break
s = int(input())
e = int(input())
step = int(input())
printTable(s, e, step)
- 4
S = int(input())
E = int(input())
W = int(input())
count = S
While count <= E :
A = (S-32) *5/9
print(S, "/t", int(A))
Count = count+W