Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int a[100];
- int n,i;
- printf("Enter the array's limit: ");
- scanf("%d",&n);
- printf("Now enter %d elements.\n",n);
- for(i=0;i<n;i++)
- scanf("%d",&a[i]);
- for(i=0; i<n; i++)
- {
- if(a[i]%3 == 0)
- printf("%d is divisible by 3\n",a[i]);
- if(a[i]%7 == 0)
- printf("%d is divisible by 7\n",a[i]);
- }
- return 0;
- }
- //Output
- //Enter the array's limit: 5
- //Now enter 5 elements.
- //3
- //6
- //7
- //12
- //14
- //3 is divisible by 3
- //6 is divisible by 3
- //7 is divisible by 7
- //12 is divisible by 3
- //14 is divisible by 7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement