logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming See What Others Are Saying!
  • Question
  • What will be output when you will execute following c code? #include void main() { signed int a = -1; unsigned int b = -1u; if(a == b) printf( "The Lord of the Rings" ); else printf( "American Beauty" ); }


  • Options
  • A. The Lord of the Rings
  • B. American Beauty
  • C. Compilation error: Cannot compare signed number with unsigned number
  • D. Warning: Illegal operation

  • Correct Answer
  • The Lord of the Rings 


  • More questions

    • 1. What are various scheduling queues?
    • Discuss
    • 2. What is the state of the processor, when a process is waiting for some event to occur?
    • Discuss
    • 3. What is Memory-Management Unit (MMU)?
    • Discuss
    • 4. SNOBOL is mainly used for

    • Options
    • A. Text Operation
    • B. String operations
    • C. List operations
    • D. Numerical operations
    • Discuss
    • 5. Convert the expression ((A + B) * C ? (D ? E) ^ (F + G)) to equivalent Prefix Notation
    • 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. 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
    • 8. Two main measures for the efficiency of an algorithm are

    • Options
    • A. Time and Space
    • B. Complexity and Memory
    • C. Data and Space
    • D. Memory and Processor
    • Discuss
    • 9. Would the following program compile? main() { int a = 10, *j; void *k; J = k = &a; J++; k++; printf ("\n%u %u", j, k); }
    • Discuss
    • 10. What would be the output of the following program? main() { char ch ='A'; printf ("%d%d", sizeof (ch), sizeof ('A')); }
    • Discuss


    Comments

    There are no comments.

Enter a new Comment