How do computers solve - (6 / 2 * (1 + 2) ?
C answer - 9
code:
#include "stdio.h"
int main() {
int a = 6 / 2 * ( 1 + 2);
printf("C answer - %d\n", a);
return 0;
}
code:
package main
import "fmt"
func main() {
a := 6 / 2 * (1 + 2)
fmt.Printf("Golang answer - %d\n", a)
}
code:
const a = 6 / 2 * (1 + 2)
console.log(`Node.JS answer - ${a}`)
code:
const a = 6 / 2 * (1 + 2)
console.log(`Deno answer - ${a}`)
code:
a = 6 / 2 * ( 1 + 2)
print("Python2 answer - " + str(a))
code:
a = 6 / 2 * ( 1 + 2 )
print("Python3 answer - " + str(a))
code:
a = 6 / 2 * (1 + 2)
puts "Ruby answer - #{a}"