Programming:-
  1. Swapping two variables x,y without using a temporary variable.
  2. Write a program for reversing the given string.
  3. The integers from 1 to n are stored in an array in a random
    fashion. but one integer is missing. write a program to find the
    missing integer.
    ans. idea. the sum of n natural numbers is = n(n+1)/2.
    if we subtract the above sum from the sum of all the
    numbers in the array , the result is nothing but the
    missing number.
  4. Write a c program to find whether a stack is progressing in forward or reverse direction.
  5. Write a c program that reverses the linked list.
C/C++:-
  1. typedef struct{
    char *;
    nodeptr next;
    } * nodeptr;
    what does nodeptr stand for?
  2. int   *x[](); means
    expl: Elments of an array can't be functions.
  3. o/p=?
    int i;
    i=1;
    i=i+2*i++;
    printf(%d,i);
    ans: 4
  4. #include
    char *f()
    {char *s=malloc(8);
    strcpy(s,"goodbye")}
    main()
    {
    char *f();
    printf("%c",*f()='A');
    o/p=?
  5. FILE *fp1,*fp2;
    fp1=fopen("one","w")
    fp2=fopen("one","w")
    fputc('A',fp1)
    fputc('B',fp2)
    fclose(fp1)
    fclose(fp2)}
    ans: no error. But It will over writes on same
    file.
  6. #define MAN(x,y) (x)>(y)?(x):(y)
    { int i=10;j=5;k=0;
    k= MAX(i++,++j)
    printf(%d %d %d %d,i,j,k)}
  7. a=10;b=5; c=3;d=3;
    if(a
  8. what is o/p
    > #include
    > show(int t,va_list ptr1)
    > {
    > int a,x,i;
    > a=va_arg(ptr1,int)
    > printf("\n %d",a)
    > }
    > display(char)
    > {int x;
    > listptr;
    > va_star(otr,s);
    > n=va_arg(ptr,int);
    > show(x,ptr);
    > }
    > main()
    > {
    > display("hello",4,12,13,14,44);
    > }
    > a) 13 b) 12 c) 44 d) 14
  9. main()
    > {
    > printf("hello");
    > fork();
    > }
  10. main()
    > {
    > int i = 10;
    > printf(" %d %d %d \n", ++i, i++, ++i);
    > }
  11. #include
    > main()
    > {
    > int *p, *c, i;
    > i = 5;
    > p = (int*) (malloc(sizeof(i)));
    > printf("\n%d",*p);
    > *p = 10;
    > printf("\n%d %d",i,*p);
    > c = (int*) calloc(2);
    > printf("\n%d\n",*c);
    > }
  12. #define MAX(x,y) (x) >(y)?(x):(y)
    > main()
    > {
    > int i=10,j=5,k=0;
    > k= MAX(i++,++j);
    > printf("%d..%d..%d",i,j,k);
    > }
  13. #include 
    > main()
    > {
    > enum _tag{ left=10, right, front=100, back};
    > printf("left is %d, right is %d, front is
    > %d, back is
    > %d",left,right,front,back);
    > }
  14. main()
    > {
    > int a=10,b=20;
    > a>=5?b=100:b=200;
    > printf("%d\n",b);
    > }
  15. #define PRINT(int) printf("int = %d  ",int)
    > main()
    > {
    > int x,y,z;
    > x=03;y=02;z=01;
    > PRINT(x^x);
    > z<<=3;PRINT(x); > y>>=3;PRINT(y);
    > }
  16. what is the o/p of the program
    main()
    {
    int rows=3,colums=4;
    int a[rows][colums]={1,2,3,4,5,6,7,8,9,10,11,12};
    i=j=k=99;
    for(i=0;i
  17. what is o/p
    main()
    {int i=3;
    while(i--)
    {
    int i=100
    i--;
    printf("%d..",i);
    }
    }
    a) infinite loop
    b) error
    c) 99..99..99..99
    d) 3..22..1..

  18. '-'=45 '/'=47
    printfr(%d/n,'-','-','-','-','/','/','/');
    o/p =?
  19. { ch='A';
    while(ch<='F'){ switch(ch){ case'A':case'B':case'C':case'D':ch++;continue; case'E':case'F':ch++; } putchar(ch); } } a)ABCDEF b.EFG c.FG d.error