Suppose two integers num1 and num2 have previously been defined and assigned values. give a while statement that keeps running so long as neither num1 or num2 is equal to -1. you do not need to provide the body of the while statement, just a properly formatted while statement and its contituation condition

Question
Asked Dec 10, 2019
1 views

Suppose two integers num1 and num2 have previously been defined and assigned values. give a while statement that keeps running so long as neither num1 or num2 is equal to -1. you do not need to provide the body of the while statement, just a properly formatted while statement and its contituation condition

check_circle

Expert Answer

Code statement:

//declaring and assigning the values

int num1=10;

int num2=20;

//condition for while statement

while((num1==-1)||(num2==-1))

{

     //Statement

}

 

Explanation:

In the above statement, the variable “num1” and “num2” are declared as “int”. It...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: what is the minimum possible depth of a d-ary tree

A: Click to see the answer

question_answer

Q: What are the SQL query commands to create the tables (attached) with appropriate attributes and data...

A: Primary key:A primary key is a minimum set of attributes (columns) in a table with uniquely defined ...

question_answer

Q: 4. Explain the steps of the fetch-decode-execute cycle. Your explanation should include what is happ...

A: Registers that are involved in the instruction cycle are as follows:Memory Address Registers (MAR): ...

question_answer

Q: Write one Python statement to store the names of five friends (you pick the names) in a list named p...

A: List in python: A list in python is a datatype that is heterogeneous in nature. That is the values o...

question_answer

Q: Define a splitstream upgrade, patch, release and version as they relate to system maintenance?

A: System maintenanceSystem maintenance is used for achieving user and organization goals. it includes ...

question_answer

Q: a. Explain what the CPU should do when an interrupt occurs. Include in your answer the method the CP...

A: Note: Since we only answer up to 3 sub-parts, we’ll answer the first 3. Please resubmit the question...

question_answer

Q: Visit the Web sites of major technology organizations {Microsoft, Oracle, and Cisco), plus two more ...

A: Websites for best security practices Microsoft creates, retains and disposes business records and in...

question_answer

Q: Simplify the following Boolean function , using three- variable maps: d) F(x,y,z) = Σ (3,5,6,7)

A: The Boolean function is defined by the algebraic expression known as Boolean expression which contai...

question_answer

Q: If the keyboard input is: A B a, what is the output for the following program and why? #include <...

A: Source Code#include <iostream>using namespace std;main(){char x,y,z;cin >> x >> y ...