thank you so much for your help...
array -5 -3 -2 1 7 -8 9
k=2
no negative, only positive result...here it would be:7
Type: Posts; User: daggg
thank you so much for your help...
array -5 -3 -2 1 7 -8 9
k=2
no negative, only positive result...here it would be:7
it's good now...one more question..how i can print only positive numbers at the end...you were so helpful...thank you.
for(i=0;i<n;i++){
if(i%k == 0)
{
indikator = 1;
printf("%d ",brojevi[i]);
3 should be here right output
prints only number that are divided by the k
Then it prits out numbers divided by k, not the index15755
No, i don't know... help me
Result should be here 4. Right?
This...15754
if(i%k == 0)
This doesn't give good result
Feel free to shoot me, or show me complete code :)
So, how to fix this?
if(brojevi[i]%k == 0)
Isn't this the same?
If the index can be divided by the k (input by the user at the beginning), then I need to printf that element, not the index...
Can you please do the whole code here, so I can test on my side. Thank you.
I already have this in my code... But thanks, anyway...
ok... i agree...help me to set it up for the first option..thanks.
I'm looking at it, but don't have the solution yet
"you want the program to return the number if the arrays index is devisable by k" yes, this is what i want
#include <stdio.h>
#define MAX 100
int main()
{
int brojevi[MAX];
int n, i, k, indikator;
Array is defined by the user (size & members)
1 2 3 4 5 6 7 8 9 10
input k
if index (not the number) can be divided with the k, then that number (not the index is printed).
For example
1...