Print the 7 up elements in the given. array An element in an array is 7up if its previous element is divisible by 7.The first element is always a 7up array .
Sample inputs:
Enter the array size :6
Input 16 17 49 3 77 21
Output 16 3 21
Explanation 16 in the first. element previous elemnt to 3, 49 is divisible by 7. Similarly previous element to 21, 77 is divisible by 7.
Answers
Answered by
2
Answer:
sorry about this but I'm still not sure how to sale this answer icant understand the importance
Answered by
0
Answer:
for(int i=1;i<n;i++)
{
if(a[i-1]%7==0)
{
printf("%d ",a[i]);
}
}
Similar questions