Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Describe the precedence of operations for the relational and logical operators,

ID: 3779715 • Letter: D

Question

Describe the precedence of operations for the relational and logical operators, what is the difference between a unary and a binary operator? When are, braces required in an if statement? What are the three different methods for performing a loop in C++? What type of loop always performs the loop statements at least once? What are the three required sets of statements for every function in C++? Name the three places in a C++ program where variables can be declared. What is the job of the return statement? What is the difference between a prototype statement and a call statement? If your prototype has a void return statement, does this mean you should enter "return 0;" at the bottom of the function? Explain.

Explanation / Answer

_

1)

The order of precedence of relational and logical operations are

<,<=,>,>=,==,!=,&&,||

2)

Unary operator:

The operators which operate on single operands are called unary operators.

Ex:

a++,a--,++b,--b etc

Binary Operators:

The operators which operate on two operands are called binary operators.

EX:

+,-,==,>

Like a+b,a-b,a==b,a>b

3)

We need braces ,if we want to execute more than one statement after the if condition .If we want to execute only one statement after the if condition then we no need of braces.

4)

The three different type of loops in c++ are

For loop,while loop,do-while loop.

5)

Do-while loop will execute for atlest one.because ,control will enter into the loop without checking any condition.The condition will be executed at the end of the loop.

do

{

-----------

-----------

}while(condition);

6)

For every function in c++, we require function call,function declaration,function definition or implementation.

7)

1)We can declare variables as global variables.so that we can use them anywhere through out the program.

2)We can declare variables inside the curly braces called local variables.we can use them only within the curcly braces in which they have been declared.

3) we can declare variables as constants and static variables also.

8)the job of the return statement is ,it will return a value to the caller of the function.

9)

Function prototype is nothing but the declaration of the function.which conatins function name,type of arguments and return type.

Where as function call will contain function name and values as arguments.but doesn’t contain any return type.

10)

If the function prototype doent contains any return statement that means a function is not returning any value to the caller of the function.at that time we have to use void.

Then we no need to write the return 0 statement at the end of the function.

____________Thank you

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote