program to find middle element of linklist?
Answer / abdur rab
struct node {
int data;
struct node* next;
};
int mid_element ( struct node* _node )
{
struct node* cur_ptr;
struct node* cur_next_ptr;
if ( NULL == _node ) return ( -1 );
else {
cur_ptr = _node;
cur_next_ptr = _node;
while ( ( NULL != cur_ptr -> next )
&& ( NULL != cur_next_ptr -
> next )
&& ( NULL != cur_next_ptr -
> next -> next ) )
{
cur_ptr = cur_ptr -> next;
cur_next_ptr = cur_next_ptr ->
next -> next;
}
}
return ( cur_ptr -> data );
}
Is This Answer Correct ? | 8 Yes | 2 No |
What are called c variables?
What is an auto variable in c?
Is struct oop?
Who had beaten up hooligan "CHAKULI" in his early college days?
What is the difference between scanf and fscanf?
How can I run c program?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
difference between my-strcpy and strcpy ?
3 Answers Geometric Software, IIM, Infosys,
main() { printf("hello%d",print("QUARK test?")); }
how 2 compile & execute c program with out using editor?
can we print any string without using terminator?