Introduction to C Language Unit-3: Strings and Length
12 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What does the length() function return when applied to the string 'C PROGRAMMING IS FUN'?

  • 18
  • 24
  • 20 (correct)
  • 22
  • According to the algorithm to calculate the length of a string, what is the initial value of 'I'?

  • 1
  • 0 (correct)
  • I
  • ' '
  • What is the ASCII code for the uppercase letter 'Z'?

  • 97
  • 90
  • 91 (correct)
  • 64
  • If the ASCII code for a lowercase character is 105, what will be the ASCII code for the corresponding uppercase character?

    <p>137</p> Signup and view all the answers

    What is the result of LENGTH('0') if the function returns the number of characters in a string?

    <p>0</p> Signup and view all the answers

    What is the result of LENGTH('') if the function returns the number of characters in a string?

    <p>0</p> Signup and view all the answers

    What is the length of the string 'C PROGRAMMING IS FUN'?

    <p>20</p> Signup and view all the answers

    What is the length of the string '0'?

    <p>1</p> Signup and view all the answers

    What is the first step in the algorithm to calculate the length of a string?

    <p>SET I = 0</p> Signup and view all the answers

    What does the length() function return for an empty string?

    <p>0</p> Signup and view all the answers

    If the ASCII code for the lowercase character is 105, what will be the ASCII code for the corresponding uppercase character?

    <p>73</p> Signup and view all the answers

    What is the ASCII code for the uppercase letter 'Z'?

    <p>90</p> Signup and view all the answers

    More Like This

    Use Quizgecko on...
    Browser
    Browser