Quiz Space

Programming in C · End Term · 1 Sept 2024 · May 2024 term · Set QDB3

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

Question 3

+3 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 3 of 25 in the IIT Madras BS Programming in C (Programming in C) End Term paper sat on 1 Sept 2024, in the May 2024 term (IIT M DEGREE AN EXAM QDB3 01 Sep 2024). It carries 3 marks.

This question was also asked in

More questions from this paper

  1. Q1Which of the following statements is/are true about the switch statement in C?
  2. Q2Figure question
  3. Q4Which of the following functions is used in C to allocate memory dynamically during runtime?
  4. Q5Which of the following statement is true about structures and unions in C regarding memory allocation?
  5. Q6Which memory region in C programming is used for storing dynamically allocated memory?
  6. Q7Which function is used to read data from a file in C programming?
  7. Q8In C preprocessor directives, what does the # operator do when used in macro definitions?
  8. Q9Consider the below C program What will be the output of the above C program?
  9. Q10What is the order in which the functions are called in the following C program?
  10. Q11Consider the below C program. What will be the output of the above C program?
  11. Q12Consider the below C program. What will be the output of the above C program?
  12. Q13Consider the below C program. What will be the output of the above C program?
  13. Q14Consider the following C program. What will be the output of the above program?
  14. Q15Consider the following C program. What will be the output of the above program?
  15. Q16Consider the following C program. What will be the output of the above program?
  16. Q17Consider the below C program. What will be the output of the above C program?
  17. Q18Consider the following C program. What will be the output of the above program?
  18. Q19Consider the following C program. What will be the output of the above program?
  19. Q20Consider the below C program. What will be the output of the above C program?
  20. Q21Consider the following C program. What will the output of the above code?
  21. Q22Select the correct statements from the below that dynamically allocate memory to hold a maximum of 4 integers. Assume t…
  22. Q23Consider the following C program. If the output of the above program is 15, then select all the options that can replac…
  23. Q24Figure question
  24. Q25Consider the following C program. What will be the output of the above program?