logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • #define clrscr() 100 main() { clrscr(); printf( "%dn", clrscr() ); }


  • Options
  • A. 100
  • B. 0
  • C. Compilation error
  • D. Exception occurs

  • Correct Answer
  • 100 

    Explanation

    Preprocessor executes as a seperate pass before the execution of the compiler. So textual replacement of clrscr() to 100 occurs.The input program to compiler looks like this :

    main ()

    {

    100;

    printf("%d\n",100);

    }

    Note: 100; is an executable statement but with no action. So it doesn't give any problem.


  • Programming problems


    Search Results


    • 1. Which of the following is not a valid escape code?

    • Options
    • A. "
    • B. \
    • C. '
    • D. =
    • Discuss
    • 2. main() { char *p; p = "Hello"; printf ("%cn", *&*p); }

    • Options
    • A. H
    • B. Hello
    • C. Compilation error
    • D. H E L L O
    • Discuss
    • 3. A source program is the program written in which level language ?

    • Options
    • A. Alpha Numeric
    • B. High-Level
    • C. Symbolic
    • D. Machine
    • Discuss
    • 4. What will be output of following c code? #include int main() { int x=123; int i={ printf("c" "++") }; for(x=0;x<=i;x++){ printf("%x ",x); } return 0; }
    • Discuss
    • 5. main() { char s[ ] = "man"; int i; for( i=0; s[ i ]; i++) printf( "n%c%c%c%c", s[ i ], *(s+i), *(i+s), i[s] ); }

    • Options
    • A. mmmm aaaa nnnn
    • B. aaaa mmmm nnnn
    • C. nnnn aaaa mmmm
    • D. None
    • Discuss
    • 6. Write a quick script for launching a new activity within your application.
    • Discuss
    • 7. The coding or scrambling of data so that humans cannot read them, is known as _____.

    • Options
    • A. Compression
    • B. Encryption
    • C. Ergonomics
    • D. Biometrics
    • Discuss
    • 8. public static void main string[] args Meaning is?
    • Discuss
    • 9. If the binary equivalent of 5.375 in normalized form is 0100 0000 1010 1100 0000 0000 0000 0000, what would be the output of the following program?
      main()
      
      {
      
          float a = 5.375 ;
      
          char *p;
      
          int i;
      
          p = ( char* ) &a ;
      
          for ( i = 0; i <= 3 ; i++ )
      
                printf ( " %02x ", (unsigned char ) p[i] );
      
      }
    • Discuss
    • 10. enum colors {BLACK,BLUE,GREEN} main() { printf( "%d..%d..%d", BLACK, BLUE, GREEN ); return(1); }

    • Options
    • A. 1..2..3
    • B. 0..1..2
    • C. 1..1..1
    • D. 0..0..0
    • Discuss


    Comments

    There are no comments.

Enter a new Comment