write a while loop to read integers from input until -1 is read. for each integer read before -1, add the integer to vector numbervect. ex: if the input is 1 6 5 3 -1, then the output is: 1 6 5 3



Answer :

As per the concept of vector, the while loop for integers is written below.

The term vector refers  a quantity or phenomenon that has two independent properties: magnitude and direction.

Here we need to write the  a quantity or phenomenon that has two independent properties: magnitude and direction.

While we looking into the given question, we have know that,

Here the input is 1 6 5 3 -1, then

the output is: 1 6 5 3

Then the function for the given statement is written as,

while ((char1 = getchar()) != '-1')  

    {  

        if (char1 == ' ')  

            sp_ct1++;  

        else if (char1 == '\n')  

            nl_ct1++;  

        else  

            other1++;  

    }  

Therefore, the above function is used to  read integers from input until -1 is read.

To know more about function here

https://brainly.com/question/28193995

#SPJ4