10) break ; } }"> 10) break ; } }">
logo

CuriousTab

CuriousTab

Discussion


Home Technical Questions Programming Comments

  • Question
  • Point out the error, if any, in the while loop. main() { int i = 1; while () { printf ( "%d", i++); if (i >10) break ; } }


  • Correct Answer
  • The condition in the while loop is a must 


  • Programming problems


    Search Results


    • 1. Point out the error, if any, in the following program. main() { int ( *p )() = fun; ( *P ) (); } fun () { Printf ( "\nLoud and clear" ); }
    • Discuss
    • 2. What is the difference between the following declarations? extern int fun(); int fun();
    • Discuss
    • 3. What would be the output of the following program? main() { extern int i; i = 20; printf( "%d", sizeof(i) ); }
    • Discuss
    • 4. 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
    • 5. 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
    • 6. Point out the error, if any, in the following program. main() { int i = 4, j = 2; switch(i) { case 1 : printf (''\n To err is human, to forgive is against company policy."); break; case j : printf (''\n if you have nothing to do, don't do it here."); break; } }
    • Discuss
    • 7. What would be the output of the following program? main() { static int a[20]; int i = 0; a[i] = i++; printf ("\n%d%d%d", a[0], a[1], i); }
    • Discuss
    • 8. What would be the output of the following program? main() { int i=2 ; printf ("\n%d%d", ++i, ++i ); }
    • Discuss
    • 9. In the following code in which order the functions would be called? a = ( f1 ( 23,14 ) * f2 ( 12/4) ) + f3() ;
    • Discuss
    • 10. Which error are you likely to get when you run the following program? main() { struct emp { char name[20]; float sal; }; struct emp e[10]; int i; for ( i = 0 ; i <= 9; i++) scanf ( "%s %f" , e[i].name, &e[i].sal ); }
    • Discuss


    Comments

    There are no comments.

Enter a new Comment