Give data by cmd?

let’s suppose i make function sum(x,y) { x + y}. I want to input(data) by cmd. how to do that?

I don’t understand what you are asking here.

Also, are you sure that you are programming Julia? The above is not valid syntax.

Sorry function sum(x,y) x + y end

Are you looking for something like

 x=parse(Float64,readline(stdin)) 
2 Likes

I interpreted your question initially as “how can I pass command line arguments to a Julia script?” (for which you can look at ArgParse.jl). But now I’m not so sure whether it is the question.

2 Likes

thank you

thank you orialb

@Ravinder_Ram, if any of the answers solve your question, it would be nice that you check the “solution” button next to it. That will help other users that might come in the future with a similar question and see this one as solved.

1 Like