Jump to content

Problema C++: Fie A Cel Mai Mare Numar Natural De Patru Cifre...


Courage

Recommended Posts

  • Moderators

Fie a cel mai mare număr natural de patru cifre distincte şi b cel mai mic număr natural de patru cifre distincte. Precizaţi care dintre expresiile C/C++ de mai jos este adevărată.

 

a. (a / b == 8) || (a % b == 0)

b. (a / b == 9) && (a % b > 0)
c. (a % b == 8) || (a / b == 0)
d. (a % b == 9) && (a / b > 0)
 
Bun, luăm a=9876 şi b=1234. Baremul zice că varianta corectă e b, dar de cand si pana cand? a%b>0 e adevarat, dar a/b nu e in niciun caz 9, ci 8. 
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.