S
S
Sm4llDev2020-05-25 18:01:15
go
Sm4llDev, 2020-05-25 18:01:15

Why is there an error in the output (golang)?

Wrote this code:

package main
import (
  "fmt"
)

func main () {
  x := 123
  fmt.Printf ("Hello %v", x)
}


For some reason, we output with a percentage at the end:
> Hello 123%

Question: why is there a percentage at the end and how to fix it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Evgeny Mamonov, 2020-05-25
@Sm4llDev

It doesn't output %
% - it's most likely that yours already outputs it.
Add the newline code "\n" to the end like this fmt.Printf ("Hello %v\n", x)and it will be what you want

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question