Professional Documents
Culture Documents
2) main(){ char *p; int *q; long *r; p=q=r=0; p++; q++; r++;
printf("%p...%p...%p",p,q,r);}Answer:
5) # include <stdio.h>
int one_d[]={1,2,3};main(){ int *ptr; ptr=one_d; ptr+=3;
printf("%d",*ptr);}Answer:
6) # include<stdio.h>
aaa() { printf("hi");}bbb(){ printf("hello"); }ccc(){ printf("bye");}
main(){ int (*ptr[3])(); ptr[0]=aaa; ptr[1]=bbb; ptr[2]=ccc;
ptr[2]();}Answer:
7) #include<stdio.h>
main(){FILE *ptr; char i; ptr=fopen("zzz.c","r");
while((i=fgetch(ptr))!=EOF) printf("%c",i);}Answer:
1
13) In the following pgm add a stmt in the function fun such that the address of
'a' gets stored in 'j'.
main(){ int * j; void fun(int **); fun(&j); }
void fun(int **k) { int a =0; /* add a stmt here*/ }Answer:
14) What are the following notations of defining functions known as?
i. int abc(int a,float b){/* some code */ }
ii. int abc(a,b) int a; float b;{/* some code*/}Answer: