logo

Crowdly

Browser

Add to Chrome

#include <stdio.h> #include <stdlib.h> struct elem {   int i;   ...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

#include <stdio.h>

#include <stdlib.h>

struct elem {

  int i;

  struct elem * next;

};

void ajouter (struct elem *list, int i){

  struct elem * e;

  e=malloc(sizeof(struct elem));

  e->i=i;

  e->next= list;

}

int main(){

  struct elem * list=NULL;

  struct elem* iter=NULL;

  int i;

  ajouter (list,1);

  ajouter (list,2);

  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 ?

More questions like this

Want instant access to all verified answers on moodle.insa-toulouse.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome