Danny AA's Profile

About

 
Points: 37

Contact

 

Danny AA
December 26, 2014 · Public

int arr[10] = { -2, 8, 23, -160, -74, 8, 85, -47, 12, 7 };
PrintMaxPartAscending(arr, 10);
that's the array

void PrintMaxPartAscending(int arr[], int size)
{
int i, j = 0, k = 0, counter1 = 0, num = 0, counter2 = 0;
printf("The original array is :\n");
for (i = 0; i < size; i++)
{
printf("%d ", arr[i]);
}
printf("\n");

for (i = 0; i < size; i++)
{
if (arr[i] < arr[i+1])
{
j = i;
counter1++;
}
}

for (i = 0; i < counter1; i++)
{
printf("%d ", arr[i]);
}
printf("\n");

}


problem with code c programming...what is not good here?
need help pls

Danny AA
December 24, 2014 · Public

New C programming challenge....
char str[][MAX_LETTERS] = { 'a', 'w', 'o', 'r', 'd', 'b', 'c', 'w',
'd', 'o', 'o', 'e', 'f', 'h', 'i', 'o',
'j', 'r', 'k', 'r', 'w', 'l', 'w', 'r',
'm', 'd', 'n', 'o', 'd', 'o', 'o', 'd',
'p', 'q', 'r', 's', 'w', 'o', 'r', 'd',
't', 'u', 'v', 'w', 'x', 'y', 'd', 'd' };

i need to make func that counts how many times the string "word" it appears.
It appears 7 times without using( string.h and pointers).
need help plsssssss

Danny AA
December 22, 2014 · Public

int CheckSaddleElement(int mat[][COLS], int rows)
{
int i=0, j=0, k=0;
int min = 0, max = 0, col = 0;
for (i = 0; i < rows; i++)
{
min = mat[i][0];
for (j = 0; j < 10; j++)
{
if (mat[i][j] = max)
max = mat[k][col];
}
}
if (max == min)
return 1;
return 0;