Você está na página 1de 5

1.

main() 20 * 1=20
{
Int i=0, j=-1, k=0, l=2 ,m;
M=i++&&j++&&k++||l++;
Printf(“%d%d%d%d%d”,i,j,k,l,m);
}

2. main()
{
int i=5,j=6,z;
printf(“%d”,i+++j);
}

3. main()
{
Unsigned i=-1;
Int j;
Printf(“%u”,++i) ;
Printf(“%u”,j=--i);
}

4. main()
{
Int i=0, j=0;
If(i++ && j)
Printf(“%d %d”,i++,j);
Printf(“%d %d”,i, j);
}

5. main()
{
Unsigned int i=65000;
While(i++!=0);
Printf(“%d”,i);
}

6. main()
{
Printf(“%x”, -1<<4);
}

7. int I;
main()
{
Int t;
For(t=4;scanf(“%d”,&i)-t;printf(“%d\n”,i))
Printf(“%d--”,t--);
}

8. main()
{
Int a=0,b=20;
Char x=1,y=10;
If(a,b,x,y)
Printf(“Hello”);
}

9. main()
{
Unsigned int I;
For(i=1;i>-2;i--)
Printf(“Accel”);
}

10. #ifdef a
Int s=0;
#endif
Main()
{
Int t=0;
Printf(“%d %d”,s,t);
}

11. main()
{
char *p="hai friends",*p1;
p1=p;
while(*p!='\0') ++*p++;
printf("%s %s",p,p1);
}

12. #define f(g,g2) g##g2


main()
{
int var12=100;
printf("%d",f(var,12));
}

13. main()
{
int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}};
printf(“%u %u %u %d \n”,a,*a,**a,***a);
printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1);
}

14. void main()


{
void *v;
int integer=2;
int *i=&integer;
v=i;
printf("%d",(int*)*v);
}

15. main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
}

16. main()
{
int a=2,*f1,*f2;
f1=f2=&a;
*f2+=*f2+=a+=2.5;
printf("\n%d %d %d",a,*f1,*f2);
}

17. . main()
{
static int a[3][3]={1,2,3,4,5,6,7,8,9};
int i,j;
static *p[]={a,a+1,a+2};
for(i=0;i<3;i++)
{
for(j=0;j<3;j++)
printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j),
*(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i));
}
}

18. #define print(int) printf(#int”=%d”,int)


Main()
{
Int x=2, y=3, z=4;
Print(x);
Print(y);
Print(z);
}

19. int main()


{
int i=5,j=5;
clrscr();
i=i++*i++*i++*i++;
printf("i=%d ",i);
j=++j*++j*++j*++j;
printf("j=%d",j);
getch();
return(0);
}

20. void swap(char *, char *);


int main()
{
char *pstr[2] = {"Hello", "Hai"};
swap(pstr[0], pstr[1]);
printf("%s\n%s", pstr[0], pstr[1]);
return 0;
}
void swap(char *t1, char *t2)
{
char *t;
t=t1;
t1=t2;
t2=t;
}

SECTION –B 15 * 2= 30

1. What is the difference between conditional if and normal if.


2. Write a program to generate Fibonacci Series..
0 1 1 2 3 5 8 13……
3. Write a program to find whether a given year is leap year or not.
4. Define enum, typedef.
5. Explain the life, scope, initial value and storage area of Storage classes.
6. Difference between structure and union.
7. Define stack. Give example.
8. Define queue. Give example.
9. Write a simple program for file inclusion.
10. Write a simple program for call by value and call by reference.
11. What is recursive function. Give example.
12. Write a program for to pass a structure to a function and access data.
13. Use of Void pointer.
14. Difference between array to a pointer and pointer to a array.
15. Write a program to print hexagon using character *.

SECTION-C 5 * 10=50

1. Write a program to implement queue.


2. Write a program to implement linked list ( insert rear and delete rear position
wise).
3. Write a c program to check weather a string is palindrome or not without
predefined string function
4. Write a program to get employee details using nested structure and use function to
print the details if employee.
5. Find the output for the following program
main()
{
static int a[]={0,1,2,3,4};
int *p[]={a,a+1,a+2,a+3,a+4};
int **ptr=p;
ptr++;
printf(“%d %d %d”,ptr-p,*ptr-a,**ptr);

*ptr++;
printf(“%d %d %d”,ptr-p,*ptr-a,**ptr);

*++ptr
printf(“%d %d %d”,ptr-p,*ptr-a,**ptr);

++*ptr;
printf(“%d %d %d”,ptr-p,*ptr-a,**ptr);

Você também pode gostar