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 |
main() { int i=10; i=!i>14; Printf ("i=%d",i); }
write a program to Insert in a sorted list
#if something == 0 int some=0; #endif main() { int thing = 0; printf("%d %d\n", some ,thing); }
Given a list of numbers ( fixed list) Now given any other list, how can you efficiently find out if there is any element in the second list that is an element of the first list (fixed list)
3 Answers Disney, Google, ZS Associates,
Write a program that find and print how many odd numbers in a binary tree
union u { union u { int i; int j; }a[10]; int b[10]; }u; main() { printf("\n%d", sizeof(u)); printf(" %d", sizeof(u.a)); // printf("%d", sizeof(u.a[4].i)); } a. 4, 4, 4 b. 40, 4, 4 c. 1, 100, 1 d. 40 400 4
Write a program to receive an integer and find its octal equivalent?
how to return a multiple value from a function?
C program to print magic square of order n where n > 3 and n is odd
how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.
19 Answers Cap Gemini, Infosys,
main(int argc, char **argv) { printf("enter the character"); getchar(); sum(argv[1],argv[2]); } sum(num1,num2) int num1,num2; { return num1+num2; }
Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal.
6 Answers Fusion Systems GmbH,