Hi, I do not know where in the code I am committing the error.
URL to Question - https://online.codingblocks.com/player/12975/content/4693
My current solution -
#include
using namespace std;
int main(){
//Declaration
int input_number_array[50];
int i =0;
int sum_of_numbers=0;
// logic, to check the number before addition. If it is, than break (loop break condition), Else continue
while(true)
{
cin>>input_number_array[i];
if(input_number_array[i]<0)
break;
else
{
cout<<input_number_array[i]<<endl;
sum_of_numbers+=input_number_array[i];
}
i++;
}
return 0;
}
Currently only one of the three test cases are passing. Please do let me know where I am wrong.