• Skip to main content
  • Skip to footer

SoftwareProg.com

Software programming learning aide

  • Blog
    • Discussion
  • News
  • CS50’s Introduction to Computer Science by Harvard University on Edx
    • Week 1
    • Week 2
    • Week 3
    • Week 4
    • Week 5

Is this a correct way to approach Boolean data type?

CS50 threads to aide as a supplementary resource › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 1 › Is this a correct way to approach Boolean data type?

  • This topic is empty.
Log In Register Lost Password
Viewing 1 post (of 1 total)
  • Author
    Posts
  • August 31, 2022 at 5:07 am #546
    admin
    Keymaster

      Instead of creating a bool data type, I find it easier to create an int data type. If the criterion meets, int x = 1.


      Copy Code
      Copied
      Use a different Browser

      
      
      int f = checkforLuhn(y);
      if (f == 1)
      {
      LUHN = 1;
      }

      Are the two ways indeed replaceable?


      Reply


      https://edstem.org/us/courses/176/discussion/1711556?[learn_press_profile]

    • Author
      Posts
    Log In Register Lost Password
    Viewing 1 post (of 1 total)
    • You must be logged in to reply to this topic.
    Log In

    Log in / Register

    Initiative by Digital Splendid OPC Pvt. Ltd.