#include <stdio.h> int main (){ char str[100]; printf("insert a string \n"); scanf("%s",str); printf("the string is %s \n",str); return 0;}
var spawn = require('child_process').spawn;var proc = spawn('./my-program.exe');
proc.stdout.on('data', function(data){
//print the output of program console.log(`${data}`);})
//function to insert inputfunction insertInput(data){ proc.stdin.setEncoding('utf-8'); proc.stdin.write(data + '\n'); proc.stdin.end();}
var exec = require('child_process').exec;var proc = exec('./my-program.exe', function(err, stdout, stderr){
//print the output of program
console.log(`${stdout}`);
});
//function to insert inputfunction insertInput(data){ proc.stdin.setEncoding('utf-8'); proc.stdin.write(data + '\n'); proc.stdin.end();}