Quiz Space

Programming in C · End Term · 13 Apr 2025 · January 2025 term · Set 1-2

Question 4: Which of the following statements correctly declares a po…

Question 4

+4 marksOne correct option

Which of the following statements correctly declares a pointer variable ptr to hold the address of a character variable ch in C and assigns the address of ch to ptr?

  1. A

    char *ptr; ptr = &ch;

  2. B

    char *ptr; ptr = *ch;

  3. C

    char ptr; ptr = &ch;

  4. D

    char ptr; ptr = *ch;

Show answer

Correct answer

  • A

    char *ptr; ptr = &ch;

Question 4 of 20 in the IIT Madras BS Programming in C (Programming in C) End Term paper sat on 13 Apr 2025, in the January 2025 term (IIT M ES REATTEMPT AN EXAM QEQ1 13 Apr). It carries 4 marks.

This question was also asked in

More questions from this paper

  1. Q1Figure question
  2. Q2Which of the following is true about recursion?
  3. Q3A 32-bit integer 0x12345678 is stored in memory starting at address 0x3000 on a little-endian system. Which of the foll…
  4. Q5In C programming, which memory region is typically used for dynamic memory allocation?
  5. Q6What does the #define directive do in C preprocessor?
  6. Q7Figure question
  7. Q8Figure question
  8. Q9Figure question
  9. Q10Figure question
  10. Q11Figure question
  11. Q12Figure question
  12. Q13Which of the following is not a valid storage class in C language?
  13. Q14Which of the following statements is/are true about the switch statement in C?
  14. Q15Which of the following statements about pointers is/are true?
  15. Q16Figure question
  16. Q17Figure question
  17. Q18Figure question
  18. Q19Figure question
  19. Q20Figure question