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 |
main() { static int a[3][3]={1,2,3,4,5,6,7,8,9}; int i,j; static *p[]={a,a+1,a+2}; for(i=0;i<3;i++) { for(j=0;j<3;j++) printf("%d\t%d\t%d\t%d\n",*(*(p+i)+j), *(*(j+p)+i),*(*(i+p)+j),*(*(p+j)+i)); } }
main() { extern int i; i=20; printf("%d",sizeof(i)); }
Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }
main( ) { char *q; int j; for (j=0; j<3; j++) scanf(“%s” ,(q+j)); for (j=0; j<3; j++) printf(“%c” ,*(q+j)); for (j=0; j<3; j++) printf(“%s” ,(q+j)); }
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped
main() { char c; int i = 456; clrscr(); c = i; printf("%d", c); } a. 456 b. -456 c. random number d. none of the above
what is oop?
void main() { int x,y=2,z; z=(z*=2)+(x=y=z); printf("%d",z); }
void pascal f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } void cdecl f(int i,int j,int k) { printf(“%d %d %d”,i, j, k); } main() { int i=10; f(i++,i++,i++); printf(" %d\n",i); i=10; f(i++,i++,i++); printf(" %d",i); }
Code for 1>"ascii to string" 2>"string to ascii"
1 Answers Aricent, Global Logic,
main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16