i need it to find the kth digit and store it in result of the function ....my function should return the resulted value to the parameter result (call by reference)
#include
int kth_digit(int n,int k,int *result)
{
int i;
int temp=n;
for(i=0;i
{
temp=temp/10;
result=&temp;
}
}
main()
{
int *result,y,m;
int c;
result=(int*)&c;
prinf("enter n:");
printf("enter k");
scanf("%d",&y);
scanf("%d",&m);
c=kth_digit(y,m,&result);
printf("digit number %d is %d",y,result%10);
}
2006-10-02
06:29:42
·
2 answers
·
asked by
myheartsuzan
2