how to check whether a linked list is circular.
Answers were Sorted based on User's Feedback
Answer / karunanidhi
start = pointer;
while(pointer)
{
if(pointer->next == start)
printf("Circular");
pointer = pointer->next;
}
printf("Non-Circular");
Is This Answer Correct ? | 42 Yes | 50 No |
#include <stdio.h> main() { char * str = "hello"; char * ptr = str; char least = 127; while (*ptr++) least = (*ptr<least ) ?*ptr :least; printf("%d",least); }
posted by surbhi just now main() { float a = 5.375; char *p; int i; p=(char*)&a; for(i=0;i<=3;i++) printf("%02x",(unsigned char) p[i]); } how is the output of this program is :: 0000ac40 please let me know y this output has come
struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }
main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O
create a C-code that will display the total fare of a passenger of a taxi if the driver press enter,the timer will stop. Every 10 counts is 2 pesos. Initial value is 25.00
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
main() { char string[]="Hello World"; display(string); } void display(char *string) { printf("%s",string); }
What is the main difference between STRUCTURE and UNION?
char *someFun() { char *temp = “string constant"; return temp; } int main() { puts(someFun()); }
main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }
29 Answers IBM, TCS, UGC NET, Wipro,
Program to find the largest sum of contiguous integers in the array. O(n)
Sir... please give some important coding questions asked by product companies..