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 implement the motion of a bouncing ball using a downward gravitational force and a ground-plane friction force. Initially the ball is to be projected in to space with a given velocity vector
#define SQR(x) x * x main() { printf("%d", 225/SQR(15)); } a. 1 b. 225 c. 15 d. none of the above
to remove the repeated cahracter from the given caracter array. i.e.., if the input is SSAD output should of SAD
main() { char *a = "Hello "; char *b = "World"; clrscr(); printf("%s", strcat(a,b)); } a. Hello b. Hello World c. HelloWorld d. None of the above
Is it possible to type a name in command line without ant quotes?
How can u say that a given point is in a triangle? 1. with the co-ordinates of the 3 vertices specified. 2. with only the co-ordinates of the top vertex given.
Write a routine that prints out a 2-D array in spiral order
main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }
main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }
main() { int i=_l_abc(10); printf("%d\n",--i); } int _l_abc(int i) { return(i++); }
main() { char a[4]="HELL"; printf("%s",a); }
Extend the sutherland-hodgman clipping algorithm to clip three-dimensional planes against a regular paralleiepiped