Program to find the largest sum of contiguous integers in
the array. O(n)
Answers were Sorted based on User's Feedback
Answer / harsha
Going by the answer 7..
max=0;
sum=0;
for i in 0 .. n
sum = sum + numbers[i];
if( sum > max ) {
max = sum;
}
else if (sum<0) {
sum=0;
}
| Is This Answer Correct ? | 0 Yes | 6 No |
Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
Is the following code legal? struct a { int x; struct a b; }
void main() { int i; char a[]="\0"; if(printf("%s\n",a)) printf("Ok here \n"); else printf("Forget it\n"); }
main() { printf("\nab"); printf("\bsi"); printf("\rha"); }
write a program in c language to get the value of arroy keys pressed and display the message which arrow key is pressed?
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
Write out a function that prints out all the permutations of a string. For example, abc would give you abc, acb, bac, bca, cab, cba. You can assume that all the characters will be unique.
5 Answers IITR, Microsoft, Nike,
why the range of an unsigned integer is double almost than the signed integer.
program to Reverse a linked list
12 Answers Aricent, Microsoft, Ness Technologies,