• Skip to main content
  • Skip to footer

CS50's Introduction to Computer Science on Edx: Supplementary resource

CS50 threads to aide as a supplementary resource

Revisiting loop in the first lecture

CS50 threads to aide as a supplementary resource › Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2 › Revisiting loop in the first lecture

Tagged: loops in C

  • This topic is empty.
Log In Register Lost Password
Viewing 1 post (of 1 total)
  • Author
    Posts
  • November 28, 2021 at 7:24 am #59
    admin
    Keymaster


      Copy Code
      Copied
      Use a different Browser

      
      
       if (c == 'Y' || c == 'y')
          {
              printf("Agreed.\n");
          }
          else if (c == 'N' || c == 'n')
          {
              printf("Not agreed.\n");
          }

       

      This code from the first lecture appears loop but must not be a loop as mentioned “And if none of the expressions are true, nothing will happen since our program doesn’t have a loop.”

      Could please anyone clarify what differentiates loop from the above code which is not a loop with if, else if. I do know there are three kinds of loop in C:

      While

      Do – While

      For


      Reply


      https://edstem.org/us/courses/176/discussion/897635?comment=2047493[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.