#include<stdio.h>
#include<stdlib.h>
int main()
{
int i, n;
struct mode
{
int num;
struct mode * next;
};
struct mode *header, *last, *temp, *present;
header = NULL;
printf("Enter the amount of people \n");
scanf("%d", &n);
for (i=1; i<n; i++)
{
temp = malloc(sizeof(struct mode));
temp -> num = 1;
temp -> next = NULL;
if (i == 1)
header = temp;
else
last-> next = temp;
last = temp;
}
present = header;
while (present != NULL)
{
printf("%6d", present->num);
temp = present;
present = present ->next;
free(temp);
}
return 0;
}