logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming See What Others Are Saying!
  • Question
  • 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); }


  • Correct Answer
  • EOF has been defined as #define EOF -1 n the file "stdioh" and an unsigned char ranges from 0 to 255 hence when EOF is read from the file it cannot be accommodated in ch Solution is to declare ch as an int 


  • More questions

    • 1. What does microprocessor speed depend on?
    • Discuss
    • 2. What does RSI stand for?
    • Discuss
    • 3. Which Stack is used in 8086?
    • Discuss
    • 4. What is object repository?
    • Discuss
    • 5. Which is the Stack used in 8085?
    • Discuss
    • 6. What does GUI stand for?
    • Discuss
    • 7. What is the main reason the OSI Model was created?
    • Discuss
    • 8. Ethernet uses which topology

    • Options
    • A. Star
    • B. Bus
    • C. Twisted pair
    • D. Both B & C
    • Discuss
    • 9. What are various scheduling queues?
    • Discuss
    • 10. What is the state of the processor, when a process is waiting for some event to occur?
    • Discuss


    Comments

    There are no comments.

Enter a new Comment