Positive and negative numbers

  • 4
Data analysis starts with a simple concept: we need to understand what data matters and should be used, and what data should be discarded. Let's solve a simple data analysis problem. We enter three integers from the keyboard, then we'll analyze them and display the number of positive and negative numbers in the source set.
You can't complete this task, because you're not signed in.
Comments (10)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Libby Level 15, London, United Kingdom
3 January, 16:09
Can anyone specify clearly what's supposed to be done to meet the last requirement?
Roman Level 41
4 January, 09:13
Please post your question with the attached solution in the section Help.
Marios Level 7, Alexandroupolis, Greece
18 September 2020, 09:17
Please, I need guidance in regards to " Note that 0 is not a positive or negative number. ". I can not pass it. Here is my source code: https://pastebin.com/xrFu2d5V I paste it here, because I exceeded the character limit.
Sekh Parvez Level 7, New York City, United States
23 October 2020, 15:39
do you still need help with this?
Devonte A Level 17, Rubery, United Kingdom
4 May 2020, 10:41
For anyone struggling on the last case, create a condition that does nothing if the value is 0. :D
Syed Huzaifa Level 7, Karachi, Pakistan
6 May 2020, 22:15
int a = 0;
       int b = 3;
       }else if(num1==0){
           // a++;
           // b--;
       }else if(num2==0){
           // a++;
           // b--;
       }else if(num3==0){
           // a++;
           // b--;
       System.out.println("Number of negative numbers: "+b);
       System.out.println("Number of positive numbers: "+a);
not working for this code
Sean Nigito Level 6, Newark, United States
7 August 2020, 17:05
you have 2 problems that i can see 1: you should make separate if statements for your inputs 2: you don't need to subtract 1 from one variable and add to another you can just add to one of them
23 August 2020, 01:20
you could use a loop for this task to make things easier.
Anita Pal Level 14, India
29 July 2019, 09:49
Can anyone help me.I am not able to find error in my code.
smaranika sahu Level 5, Pune, India
16 July 2019, 07:25
Can anyone help me what is wrong in my code?