F
5 Questions
1 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

Which of the following is a correct statement about the given text?

  • The maximum marks for Q.1 is 5.
  • The time allocated for the exam is 2.5 hours.
  • Questions 2 to 5 carry equal marks. (correct)
  • The total number of pages is 14.
  • What is the correct pseudocode to check if a number is positive or negative?

  • if (num >= 0) print 'Positive'; else print 'Negative'; (correct)
  • if (num < 0) print 'Positive'; else print 'Negative';
  • if (num > 0) print 'Positive'; else print 'Negative';
  • if (num != 0) print 'Positive'; else print 'Negative';
  • Which of the following statements about arrays is true?

  • Arrays can store elements of different data types.
  • Arrays cannot store more than 10 elements.
  • Arrays automatically resize based on the number of elements.
  • Arrays can only store elements of the same data type. (correct)
  • What is the difference between getchar and gets?

    <p>getchar reads a single character, while gets reads a string including spaces.</p> Signup and view all the answers

    What is the correct pseudocode to find the addition of the first 20 numbers and print it?

    <p>sum = 0; for (i=1; i&lt;=20; i++) sum += i; print sum;</p> Signup and view all the answers

    Use Quizgecko on...
    Browser
    Browser