logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • What will be output of following program? #include int main() { void (*p)(); int (*q)(); int (*r)(); p = clrscr; q = getch; r = puts; (*p)(); (*r)("www.curioustab.com"); (*q)(); return 0; }


  • Options
  • A. NULL
  • B. www.curioustab.com
  • C. Compilation error
  • D. None of above

  • Correct Answer
  • www.curioustab.com 

    Explanation

    p is pointer to function whose parameter is void and return type is also void. r and q is pointer to function whose parameter is void and return type is int . So they can hold the address of such function.


  • Programming problems


    Search Results


    • 1. What value does read() return when it has reached the end of a file?

    • Options
    • A. 1
    • B. -1
    • C. 0
    • D. None
    • Discuss
    • 2. Convert the expression ((A + B) * C ? (D ? E) ^ (F + G)) to equivalent Prefix Notation
    • Discuss
    • 3. public abstract interface Frobnicate { public void twiddle(String s); } Which is a correct class?

    • Options
    • A. public abstract class Frob implements Frobnicate { public abstract void twiddle(String s) { } }
    • B. public abstract class Frob implements Frobnicate { }
    • C. public class Frob extends Frobnicate { public void twiddle(Integer i) { } }
    • D. public class Frob implements Frobnicate { public void twiddle(Integer i) { } }
    • Discuss
    • 4. Macro flowchart is also called as

    • Options
    • A. Less Detail flowchart
    • B. More detail flowchart
    • C. Simple detailed flowchart
    • D. None of the above
    • Discuss
    • 5. How many times the following program would print 'Jamboree'? main() { printf ( "\nJamboree"); main (); }
    • Discuss
    • 6. What would be the output of the following program? main() { char a[] = "Visual C++"; char *b = "Visual C++"; printf ("\n%d %d", sizeof (a), sizeof (b)); printf ("\n%d %d", sizeof (*a), sizeof (*b)); }
    • Discuss
    • 7. How would you find the length of each string in the following Program? main() { char *str[] = { "Frogs", "Do", "Not" , "Die" , "They" , "Croak!"}; printf ("%d%d", sizeof (str), sizeof (str[0])); }
    • Discuss
    • 8. Point out the error, if any, in the following program. #include "stdio.h" main() { unsigned char; FILE *fp; fp = fopen ("trail", "r"); while (( ch = getc (fp)) ! = EOF) printf ("%c", ch); fclose (fp); }
    • Discuss
    • 9. Point out the error, if any, in the following program. #include "stdarg.h" main() { display ( 4, 12.5, 13.5, 14.5, 44.3); } display(int num, ...) { float c; int j; va_list ptr; va_start (ptr, num); for ( j = 1; j <= num; j++) { c = va_arg ( ptr, float ); printf ("\n%f", c); } }
    • Discuss
    • 10. What would be the output of the following program? main() { char huge * near * far *ptr1; char near * far * huge *ptr2; char far * huge * near *ptr3; printf ("%d%d%d", sizeof (ptr1), sizeof (ptr2), sizeof (ptr3)); }
    • Discuss


    Comments

    There are no comments.

Enter a new Comment