Given an array of size N in which every number is between 1
and N, determine if there are any duplicates in it. You are
allowed to destroy the array if you like.
Answers were Sorted based on User's Feedback
Answer / purnank
Get the summation. If it is not equal to (2N + 1)/2, you
surely have duplicates.
| Is This Answer Correct ? | 11 Yes | 46 No |
void main() { int i=5; printf("%d",i++ + ++i); }
Is there any difference between the two declarations, 1. int foo(int *arr[]) and 2. int foo(int *arr[2])
main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
main() { char a[4]="HELLO"; printf("%s",a); }
main() { extern int i; i=20; printf("%d",sizeof(i)); }
main() { int *j; { int i=10; j=&i; } printf("%d",*j); }
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail
main() { int a=2,*f1,*f2; f1=f2=&a; *f2+=*f2+=a+=2.5; printf("\n%d %d %d",a,*f1,*f2); }
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }
Is the following statement a declaration/definition. Find what does it mean? int (*x)[10];
main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }