+ 1

How to write this c++ program in JS

#include <iostream> using namespace std; int mani(){ int n,m,i cin>>n>>m; int a[n],b[m]; for (i=0;i<n;i++)cin>>a[i]; for (i=0;i<m;i++)cin>>b[i];

16th Jul 2018, 12:22 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar
14 Respostas
+ 3
I find what was problem. I using qbasic and c++ 2 years ago and I forgot to input "="
16th Jul 2018, 1:12 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar
+ 2
thanks Calvin. Great article on WebAssembly !!
16th Jul 2018, 2:17 PM
Lisa F
Lisa F - avatar
+ 1
Simple. Learn JavaScript. Easy.
16th Jul 2018, 12:29 PM
Paul Grasser
Paul Grasser - avatar
+ 1
It's easy to run C++ program in JavaScript now by using WebAssembly. Follow this easy tutorial to compile your C++ to JavaScript https://medium.freecodecamp.org/get-started-with-webassembly-using-only-14-lines-of-javascript-b37b6aaca1e4
16th Jul 2018, 12:51 PM
Calviղ
Calviղ - avatar
0
Cлaвeн Ђервида You'll have to learn Javascript to do that
16th Jul 2018, 12:31 PM
Dlite
Dlite - avatar
0
It is similar to this code as every language will have same fundamental ( variable , function , array , loops ). There would be change in only syntax i.e variable would be declared with var keyword instead of int. I would have given you code but believe me it wouldnt enhance your skill in js. So try it , if you face any difficulty I would happy to help you☺️☺️.
16th Jul 2018, 12:40 PM
Meet Mehta
Meet Mehta - avatar
0
I dont know how to input more that one varriable and decler a array
16th Jul 2018, 12:49 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar
0
To declare multiple variable and array var a=1,b=2,c=3; var m=["hii" , "hello"]; Hope this helps☺️☺️.
16th Jul 2018, 1:00 PM
Meet Mehta
Meet Mehta - avatar
0
input, but this is useful too
16th Jul 2018, 1:01 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar
0
cin>>a>>b>>c; in JS
16th Jul 2018, 1:02 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar
0
Using prompt. I would highly recommend to learn Js first because it would be hard to understand at beginning.
16th Jul 2018, 1:07 PM
Meet Mehta
Meet Mehta - avatar
0
Can you help me in code please
16th Jul 2018, 1:08 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar
0
I can't declare array
16th Jul 2018, 1:09 PM
Cлaвeн Ђервида
Cлaвeн Ђервида - avatar
0
Cлaвeн Ђервида var array= [ ]; it's that easy
16th Jul 2018, 1:11 PM
Dlite
Dlite - avatar