✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
#include <stdlib.h>
struct elem {
int i;
struct elem * next;
};
struct elem * ajouter (struct elem *list, int i)
{
struct elem * e;
e=malloc(sizeof(struct elem));
e->i=i;
e->next= list;
return (e);
}
int main()
{
struct elem * list=NULL;
struct elem* iter=NULL;
int i;
list=ajouter (list,1);
list=ajouter (list,2);
list=ajouter (list,3);
iter=list;
for (i=0;i<2;i++){
if (iter){
printf("%d ",iter->i);
iter=iter->next;
}
}
return 0;
}
Que va afficher ce programme ?