write a C code To reverse a linked list
Answers were Sorted based on User's Feedback
Answer / sujith
include <stdio.h>
typedef struct list {
list_t *next;
int data;
}list_t;
list_t *list_reverse(list_t *list)
{
list_t *rlist = NULL;
while (list != NULL)
{
list_t *next = list->next;
list->next = rlist;
rlist = list;
list = next;
}
return rlist;
}
This will do the job.
Plese do verify this.
Sujith
| Is This Answer Correct ? | 27 Yes | 12 No |
typedef struct { int i:8; char c:9; float f:20; }st_temp; int getdata(st_temp *stptr) { stptr->i = 99; return stptr->i; } main() { st_temp local; int i; local.c = 'v'; local.i = 9; local.f = 23.65; printf(" %d %c %f",local.i,local.c,local.f); i = getdata(&local); printf("\n %d",i); getch(); } why there there is an error during compiling the above program?
Write a function to find the area of a triangle whose length of three sides is given
find the value of y y = 1.5x+3 for x<=2 y = 2x+5 for x>2
What compilation do?
7 Answers Geometric Software, Infosys,
what are the advantage of pointer variables? write a program to count the number of vowels and consonants in a given string
How can I call a function, given its name as a string?
How to explain the final year project as a fresher please answer with sample project
Why doesnt long int work?
hi any body pls give me company name interview conduct "c" language only
Is c programming hard?
What is the default value of local and global variables in c?
write a C program:There is a mobile keypad with numbers 0-9 and alphabets on it. Take input 0f 7 keys and then form a word from the alphabets present on the keys.
1 Answers 91mobiles, Amazon, App Guruz, College School Exams Tests, Folio3, Infosys, Omega, Planin, Riphah International University, Subex,