knoowgle logo
HOME
TOPICS
CONTRIBUTE ADVERTISE
T & C
KNOOWGLE

C-Programing Sample test 3

  1. In declaration what type of variable is P?
  2. int (*p[10]) ();




  3. What is the output of the Program?
  4. struct emp
    {
      int a=25;
      char b[20]=”abc”;
    };
    main ()
    {
      emp e;
      e.a=2;
      strcpy(e.b,”def”);
      printf(”%d %s”,e.a,e.b);
    }

    (a)  2 def
    (b)  25 tgk
    (c)  Compile error
    (d)  <blank>


  5.           What is the output of the Program?
  6. main()
    {
      int a=5;
      const int *p=&a;
      *p=200;
      printf(”%d”,*p);
    }

    (a)  200
    (b)  5
    (c)  Compiler Error
    (d)  Random value.

  7. What is the output of the Program?
  8. #define SQ(x) x*x
    main()
    {
      int a=SQ(2+1);
      printf(”%d”,a);
    }

    (a) 9
    (b) 4
    (c) 0
    (d) 5

  9. What is the output of the following         
    main()
    {
      struct t
      {
        int i;
      } a,*p=&a;
      p->i=10;
      printf(”%d”,(*p).i);
    }

  10. (a) 10
    (b) 0
    (c) 100
    (d) Compiler Error



    Click here for answers

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