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 |
#define DIM( array, type) sizeof(array)/sizeof(type) main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr, int)); }
main() { char a[4]="HELL"; printf("%s",a); }
Is it possible to type a name in command line without ant quotes?
respected sir, i did my MCA in 2013 when i am going to attend to an interview i was asked about my project how will i explain my project could please help me in this and my project title is "Social Networking Site For Social Responsibility"
main() { unsigned int i=10; while(i-->=0) printf("%u ",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
Write a program that produces these three columns sequence nos. using loop statement Sequence nos. Squared Squared + 5 1 1 6 2 4 9 3 9 14 4 16 21 5 25 30
main() { int i = 258; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); }
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
How can i find first 5 natural Numbers without using any loop in c language????????
typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }
write a origram swaoing valu without 3rd variable