online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
package main import "fmt" func isPrime(n int) bool { if n < 2 { return false } // Try dividing by all numbers from 2 to sqrt(n). for i := 2; i*i <= n; i++ { if n % i == 0 { return false } } // If we get here, we didn't find a factor, so n is prime. return true } func main() { var name string fmt.Print("What is your name? ") fmt.Scanln(&name) fmt.Println("Hello, " + name + "!") var number int fmt.Print("What is your favorite number? ") fmt.Scanln(&number) fmt.Print("Your favorite number is ", number) if isPrime(number) { fmt.Println(", and that's a prime number!") } else { fmt.Println(". It's not a prime number, but that's okay!") } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue