logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • What will be output of following c code? void main() { struct india { char c; float d; }; struct world { int a[3]; char b; struct india orissa; }; struct world st ={{1,2,3},'P','q',1.4}; clrscr(); printf("%dt%ct%ct%f",st.a[1],st.b,st.orissa.c,st.orissa.d); getch(); }


  • Correct Answer
  • Output: 2 p q 1400000 


  • Programming problems


    Search Results


    • 1. Write a c program to copy a data of file to other file.
    • Discuss
    • 2. Write a program for matrix multiplication in c
    • Discuss
    • 3. Write a c program for binary search.
    • Discuss
    • 4. Write a c program for merge sort.
    • Discuss
    • 5. Write a c program for insertion sort.
    • Discuss
    • 6. What is the output of this C code? #include void m() { printf("hi"); } void main() { m(); }

    • Options
    • A. hi
    • B. Run time error
    • C. None
    • D. Varies
    • Discuss
    • 7. The output of the code below is #include int *m() { int *p = 5; return p; } void main() { int *k = m(); printf("%d", k); }

    • Options
    • A. 5
    • B. Junk value
    • C. 0
    • D. Error
    • Discuss
    • 8. What would be the output of the following program? main() { extern int i; i = 20; printf( "%d", sizeof(i) ); }
    • Discuss
    • 9. What is the difference between the following declarations? extern int fun(); int fun();
    • Discuss
    • 10. Point out the error, if any, in the following program. main() { int ( *p )() = fun; ( *P ) (); } fun () { Printf ( "\nLoud and clear" ); }
    • Discuss


    Comments

    There are no comments.

Enter a new Comment