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 |
#define int char main() { int i=65; printf("sizeof(i)=%d",sizeof(i)); }
how to test pierrot divisor
main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }
Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.
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 i=5,j=6,z; printf("%d",i+++j); }
how to return a multiple value from a function?
Give a oneline C expression to test whether a number is a power of 2?
25 Answers EA Electronic Arts, Google, Motorola,
main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }
void main() { int c; c=printf("Hello world"); printf("\n%d",c); }
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped
how to check whether a linked list is circular.