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 |
write a c program to find biggest of 3 number without relational operator?
What is false about the following A compound statement is a.A set of simple statments b.Demarcated on either side by curly brackets c.Can be used in place of simple statement d.A C function is not a compound statement.
1. Write a program to reverse every second word in a given sentence.
The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?
Explain the difference between malloc() and calloc() in c?
actually i have 2 years teaching experience as computer faculty but now i am a DBA but when i go for interview many peoples asked me why i left my teaching profession and why i want to come in this field kindly give me the proper answer of this queston
Explain what would happen to x in this expression: x += 15; (assuming the value of x is 5)
what is the code to display color fonts in the output?
Please send me WIPRO technical question to my mail ID.. its nisha_g28@yahoo.com please its urgent
what is compiler
what is the purpose of the code, and is there any problem with it. unsigned int v[10]; unsigned int i = 0; while (i < 10) v[i] = i++;
Explain modulus operator.