//Get the SUM of top 3 Numbers.
var foo = "23,45,21,09,33,98,36,89,-11,09,4";
Loading
//Get the SUM of top 3 Numbers.
var foo = "23,45,21,09,33,98,36,89,-11,09,4";
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Muhammad Imran AnsariPosted Oct 26, 2022, 4:16 PM
Hi Javed,
Use the following code to get your result.
Rajanikant HawaldarPosted Oct 27, 2022, 2:10 PM
Abhishek YadavPosted Oct 27, 2022, 8:40 AM
int sum = 0; for (int i = 0; i < 3; i++) // more obvious about N elements (i.e: First 3) sum += numbers[i];