C Programming Skills Test: Quiz!

10 Questions | Attempts: 325
Share

SettingsSettingsSettings
C Programming Skills Test: Quiz! - Quiz

.


Questions and Answers
  • 1. 
    Find Error/Output in following code: How many times "Placement Question" will print. int main()  {   int x;   for(x=-1; x<=10; x++)   {     if(x < 5)       continue;     else       break;     printf("Placement Question");   }    return 0; }
    • A. 

      Infinite Time

    • B. 

      11 Times

    • C. 

      0 Times

    • D. 

      10 Times 

  • 2. 
    Find Error/Output in following code: int main() {   int a = 10, b = 25;   a = b++ + a++;   b = ++b + ++a;   printf("%d %d n", a, b); } 
    • A. 

      36 64

    • B. 

      35 62

    • C. 

      36 63

    • D. 

      20 28

  • 3. 
    Find Error/Output in following code: void fn() {   static int i = 10;   printf("%d ", ++i); } int main() {   fn();   fn(); }
    • A. 

      10 10

    • B. 

      11 11

    • C. 

      11 12

    • D. 

      12 12

  • 4. 
    Find Error/Output in following code: int main() {   int m = -10, n = 20;   n = (m < 0) ? 0 : 1;   printf("%d %d", m, n); }
    • A. 

      -10 0

    • B. 

      10 20

    • C. 

      20 -10

    • D. 

      0 1

  • 5. 
    Find Error/Output in following code: int main() {   int x = 0, y = 0;   if(x > 0)     if(y > 0)       printf("True");    else     printf("False");  }
    • A. 

      No Output

    • B. 

      True

    • C. 

      False

    • D. 

      Error - Dangling Problem

  • 6. 
    What is output : #include <stdio.h> int main() { printf("crazyfor\code\n"); return 0; }  
    • A. 

      Crazyforcode

    • B. 

      Crazyfor code

    • C. 

      Codeyfor

    • D. 

      Crazyfor

  • 7. 
    Output of following program? # include <stdio.h> void fun(int *ptr) {     *ptr = 30; }   int main() {   int y = 20;   fun(&y);   printf("%d", y);     return 0; }
    • A. 

      20

    • B. 

      30 

    • C. 

      Compile Error 

    • D. 

      Runtime Error

  • 8. 
    char *ptr; char myString[]="abcdefg"; ptr=myString ptr+=5; The pointer ptr points to which string?
    • A. 

      Fg

    • B. 

      Efg

    • C. 

      Defg

    • D. 

      Cdefg

  • 9. 
    Given float *pf; int *pi; Which of the following is true?
    • A. 

      Sizeof(pf) > sizeof(pi)

    • B. 

      Sizeof(pi) < sizeof(pf)

    • C. 

      Sizeof(pf) == sizeof(pi)

    • D. 

      None

  • 10. 
    Which of the following is not a valid C variable name?
    • A. 

       int number;

    • B. 

      Float rate;

    • C. 

      Int variable_count

    • D. 

      Int $main;

Back to Top Back to top
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.