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

1st Jul 2018, 6:28 AM
Goldstien
Goldstien - avatar
7 Réponses
- 2
don't worry i figured it out https://code.sololearn.com/cj1J3YdP4Hz3
1st Jul 2018, 8:42 AM
Goldstien
Goldstien - avatar
+ 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"; } }
14th Jun 2019, 10:39 AM
Sarvesh Anand
Sarvesh Anand - avatar
0
Where is your code?
1st Jul 2018, 8:07 AM
KrOW
KrOW - avatar
0
code??
21st May 2019, 2:46 PM
deepak yadav
deepak yadav - avatar
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
30th Nov 2019, 4:17 PM
Kris
Kris - avatar
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)
24th Nov 2022, 4:40 PM
Shubha T
Shubha T - avatar
- 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
17th Jul 2020, 3:24 PM
Kajal Saini
Kajal Saini - avatar