Hi All,
Good Afternoon.
My name is Kareem.
I recently started learning GO on my own.
I am going through the book "INTRODUCTION TO GO" from RIELY.
I wrote a program to convert Degrees to Fahrenheit. It is as follows:
package main
import "fmt"
func main () {
fmt.Println("Enter the degrees to convert into farenhiet: ")
var Degrees float64
fmt.Scanf("%f", &Degrees)
var farenhiet float64
farenhiet = ((Degrees*9)/5) + 32
fmt.Println("&Degrees Degrees to Farenhiet is = ", Degrees, farenhiet)
}
In th last statement " fmt.Println("&Degrees Degrees to Farenhiet is = ", Degrees, farenhiet)" I wanted to print the value of the degrees and then the result.
I am struggling with this.
Can anyone please tell me what should I change in order to get the right output?
For example:
I want to change 10 degrees to Fahrenheit.
I want to print "10 degrees to Fahrenheit is = 50"
Please help me with the code to print the exact line that I want.
I understand I can write the same statement as above but what I want exactly is that we never know what number(degrees) we input.
So please help me modify the code as per my requirement.
PS: Please help me with any books to read after the above mentioned book.
Thank You.