After execution of the following code what is the value of t

After execution of the following code, what is the value of the int variable N if the user inputs the value 0 ? (The following code may have been indented incorrectly) cin > greaterthan N; if(!(N

Solution

For N=0; the above code will result in value of N = 15.

Explanation:

Since, N is less than 5 therefore N<5 evaluates to true but unary operator (!) make it false. So , overall if portion will not be execured.

Now, the statement after if portion will defenitely going to be executed; resulting in N = 0+15; i.e. 15.

 After execution of the following code, what is the value of the int variable N if the user inputs the value 0 ? (The following code may have been indented inco

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site