GUVI
Back

program doubt

Created 2 years ago
33 Views
2 Comments
RevathiVidhya
@RevathiVidhya
RevathiVidhya
@RevathiVidhyaProfile is locked. Login

How to print output in a single line?

my code

let a = userInput[0].split(" ");

let m = 0;

for(let i=0;i<=a[0];i++)

{

m+=parseInt(a[0]);

console.log(m);

}

5
10
15
20
25
30

My o/p should be like this 5 10 15 20...(spaces between them)

Comments (2)
Please login to comment.
 
Powered by habitate.io Habitate