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 |
main() { char *cptr,c; void *vptr,v; c=10; v=0; cptr=&c; vptr=&v; printf("%c%v",c,v); }
‎#define good bad main() { int good=1; int bad=0; printf ("good is:%d",good); }
write a program to Insert in a sorted list
const int perplexed = 2; #define perplexed 3 main() { #ifdef perplexed #undef perplexed #define perplexed 4 #endif printf("%d",perplexed); } a. 0 b. 2 c. 4 d. none of the above
write a program to count the number the same (letter/character foreg: 's') in a given sentence.
C program to print magic square of order n where n > 3 and n is odd
main( ) { int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}}; printf(“%u %u %u %d \n”,a,*a,**a,***a); printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1); }
void main() { int const * p=5; printf("%d",++(*p)); }
3 Answers Infosys, Made Easy, State Bank Of India SBI,
main() { int a=10,*j; void *k; j=k=&a; j++; k++; printf("\n %u %u ",j,k); }
Write a single line c expression to delete a,b,c from aabbcc
main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }
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