xxxxxxxxxx
package main
import (
"fmt"
"strconv"
)
func main() {
str := "3.14"
f, err := strconv.ParseFloat(str, 64)
if err != nil {
fmt.Println("Error:", err)
return
}
fmt.Println(f) // Output: 3.14
}
xxxxxxxxxx
#include <iostream>
using namespace std;
// Main() function: where the execution of program begins
int main()
{
// prints hello world
cout << "Hello World";
return 0;
}
xxxxxxxxxx
const bitSize = 64 // Don't think about it to much. It's just 64 bits.
floatNum, err := strconv.ParseFloat("123.45", bitSize)
fmt.Println(fmt.Sprintf("%f", floatNum))
xxxxxxxxxx
#include <iostream>
int main() {
std::cout << "Hello World!" << std::endl;
return 0;
}
xxxxxxxxxx
#include <iostream>
using namespace std;
int main(){
cout << "Hello World" << endl;
return 0;
}
xxxxxxxxxx
#include<iostream>
using namespace std;
int main()
{
cout<<"Hello World";
return 0;
}