knoowgle logo
HOME
TOPICS
CONTRIBUTE ADVERTISE
T & C
KNOOWGLE

C-Programing Sample test 4

  1. Will this program Compile without error?
  2. func.c file
    ———-
    /* This is func.c file*/
    /*printf(”function demo”);*/
    abc.c file
    ———-
    main()
    {
    #include”func.c.c”
    printf(”function demo”);
    };

    (a)  Yes
    (b)  No


  3. Will this program Compile without error?
  4. void main()
    {
      void *vptr = (void *) malloc(sizeof(void));
      vptr++;
    }

    (a)  Yes
    (b)  No


  5. Will this program Compile without error?
  6. void main()
    {
      char *cptr = 0x2000;
      long *lptr = 0x2000;
      cptr++;
      lptr++;
      printf(” %x %x”, cptr, lptr);
    }

    (a)  Yes
    (b)  No

  7. What is the output of the Program?
  8. main()
    {
      int x=20;int y=35;
      x=y++ +x++;
      printf("%d",x);
    }


    (a) 55
    (b) 56
    (c) 59
    (d) 58

  9. What is the output of the following         
    main()
    {
      int i = -1 ,j= -1, k = 0, l = 2, m;
      m = i++&& j++&&k++||l++;
    printf("%d %d %d %d %d",i,j,k,l,m);
    }

  10. (a) -1 -1 1 3 1
    (b) -1 0 0 2 0
    (c) 0 0 1 3 1
    (d) 0 0 0 2 0



    Click here for answers

Google
 
Web www.knoowgle.com
Contributed by: www.knoowgle.com
Copyright 2006 knoowgle.com