1. Write a program to reverse a linked list.
  2. char a =0xAA ;
    int b ;
    b = (int) a ;
    b = b >> 4 ;
    printf("%x",b);

    What is the output of the above program segment ?
  3. struct s1 { struct { struct { int x; } s2 } s3 }y;
    How does one access x in the above given structure definition ?
  4. What is the worst case complexity of Quick sort?

    Ans. O(n2)
  5. What is the size of the array declared as double * X[5] ?

    Ans. 5 * sizeof ( double * )
  6. void f(int y)
    {
    struct s *ptr;
    ptr = malloc (sizeof (struct)+99*sizeof(int));
    }

    struct s{
    int i;
    float p;
    };

    when free (ptr) is executed, then what will happen?
  7. Swap two variables x,y without using a temporary variabl
  8. Write algorithm for finding the GCD of a number.
  9. Write a program for reversing the given string.
  10. For the following C program

    #define AND &&
    #define ARRANGE (a>25 AND a<50)
    main()
    {int a = 30;
    if (ARRANGE)
    printf("within range");
    else
    printf("out of range");
    }

    What is the output?

  11. For the following C program

    #define AREA(x)(3.14*x*x)
    main()
    {float r1=6.25,r2=2.5,a;
    a=AREA(r1);
    printf("\n Area of the circle is %f", a);
    a=AREA(r2);
    printf("\n Area of the circle is %f", a);
    }

    What is the output?

    Ans. Area of the circle is 122.656250
    Area of the circle is 19.625000

  12. Write a C program that reverses the linked list.