josh technology Company Programming

#include
struct node
{
int value ;
struct node *next;

};
/*void fun(int *p)
{
int q=10;
printf("function %dn",*p);
p=&q;
printf("function %dn",*p);
}*/
void rearrange(struct node *list)
{
struct node *p,*q;
int temp;
if((!list)||!list->next)
return;
p=list;
q=list->next;
while(q)
{
temp=p->value;
p->value=q->value;
q->value=temp;
p=q->next;
q=p?p->next:0;

}
}

Read Solution (Total 4)

josh technology Other Question

#include
void fun(int *p)
{
int q=10;
p=&q;
}
int main(void) {
int r=20;
int *p=&r;
fun(p);
printf("%d",*p);
return 0;
}