Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I cant figure this on C + + Given two integers N 1 and N 2 , write a program to display a number based

I cant figure this on C++Given two integers N1 and N2, write a program to display a number based on following conditions:
0 if N1 is 5 and N2 is 2.
1 if N1 is 5 and N2 is not 2.
2 if N1 is not 5 and N2 is 2.
3 if N1 is not 5 and N2 is not 2.
Use nested-if-else statement.
Example Input
5
4
Output
1
Here, N1=5 and N2!=2. Hence, the result is 1 according to the given conditions.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions

Question

What were the reasons for your conversion or resistance?

Answered: 1 week ago

Question

1. Who should participate and how will participants be recruited?

Answered: 1 week ago