omkar nath's Profile

About

 
Points: 3

Contact

 

Drop files in here
or click to pick manually
omkar nath
August 26, 2015 · Public

is something is wrong with my code ...

// LINKED LIST : inserting a node a beginning.
#include <stdio.h>
#include <stdlib.h>
struct node {
int data;
struct node*next;
};
struct node*head;// global variable
void insert(int x)
{struct node* temp =(struct node *)malloc(sizeof(struct node));
temp -> data = x;
temp -> next = head;
head = temp ;
}
void print (){
struct node*temp = head;
printf("list is : ");
while (temp != NULL)
{
printf ("%d",temp -> data);
head = head -> next ;
}
printf("\n");
}
int main(){
head = NULL;
printf ("how many numbers ? \n");
int n,i,x;
scanf ("%d",&n);
for (i=0;i<n;i++)
{
printf("enter the numbers \n");
scanf ("%d",&x);
insert (x);
print ();
}
}


omkar nath
August 11, 2015 · Public

can anybody tell me the procedure or suggest a video that HOW CAN I UNBLOCK THINGS when it is blocked on our collage network ... plss ..
SAVE A LIFE ...