logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming See What Others Are Saying!
  • Question
  • What will be output of following c code? void main() { struct bitfield { unsigned a:5; unsigned c:5; unsigned b:6; }bit; char *p; struct bitfield *ptr,bit1={1,3,3}; p=&bit1; p++; clrscr(); printf("%d",*p); getch(); }


  • Correct Answer
  • Output: 12 Explanation: Binary value of a=1 is 00001 (in 5 bit) Binary value of b=3 is 00011 (in 5 bit) Binary value of c=3 is 000011 (in 6 bit) In memory it is represented as: Let address of bit1 is 500 which initialize to char pointer p Since can is one byte data type so p++ will be 501 *p means content of memory location 501 which is (00001100) and its binary equivalent is 12 Hence output is 12 


  • More questions

    • 1. In the relational model, relationships between relations or tables are created by using:

    • Options
    • A. composite keys.
    • B. determinants.
    • C. candidate keys.
    • D. foreign keys.
    • Discuss
    • 2. What does microprocessor speed depend on?
    • Discuss
    • 3. What does RSI stand for?
    • Discuss
    • 4. Which Stack is used in 8086?
    • Discuss
    • 5. What is object repository?
    • Discuss
    • 6. Which is the Stack used in 8085?
    • Discuss
    • 7. What does GUI stand for?
    • Discuss
    • 8. What is the main reason the OSI Model was created?
    • Discuss
    • 9. Ethernet uses which topology

    • Options
    • A. Star
    • B. Bus
    • C. Twisted pair
    • D. Both B & C
    • Discuss
    • 10. What are various scheduling queues?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment