Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,988 questions

51,933 answers

573 users

How to use strings, integers, floats and booleans with calculation in Println with Go

1 Answer

0 votes
package main
 
import (
  "fmt"
)
 
func main() {
    fmt.Println("golang" + " " + "nodejs")
         
    fmt.Println("1) ", 12 + 98)
    fmt.Println("2) ", 3.14 + 1)
    fmt.Println("3) ", 11.0/5.0)
    fmt.Println("4) ", 4.38/2.0)
     
    fmt.Println("5) ", true || false)
    fmt.Println("6) ", true && false)
    fmt.Println("7) ", !true)
}
 
 
 
/*
     
run:
 
golang nodejs
1)  110
2)  4.14
3)  2.2
4)  2.19
5)  true
6)  false
7)  false
 
*/

 



answered Feb 20, 2020 by avibootz
edited Feb 20, 2020 by avibootz

Related questions

...