Write a program which fills an array of integers of size 15. This program must show the elements of the array which are multiple of 7.
Difficulty level
This exercise is mostly suitable for students
#include <stdio.h>
#include <math.h>
int main()
{
int A[15];
int I;
for (I=0 ; I<15 ; I++)
{
printf("Enter element %d : ", I+1);
scanf("%d", &A[I]);
}
for (I=0 ; I<15 ; I++)
if(A[I]%7==0)
printf("%d ", A[I]);
return 0;
}
Back to the list of exercises
Looking for a more challenging exercise, try this one !!
Delete common elements in two binary search trees