Develop and execute a c program to store n numbers in array and print the number that are divisible by five with the array location
Answers
Answered by
8
Answer:
include <stdio.h>
const int MAX = 5;
int main() {
int num[MAX];
int i=0;
while( i<MAX ) {
printf( "Enter number : " );
scanf( "%d", &num[i] );
i++;
}
printf( "\n" );
printf( "List of numbers:\n" );
for( i=0; i<MAX; i++ ) {
printf( "%d\n", num[i] );
}
return 0;
Answered by
0
Answer:
Given an array of numbers, find the number among them such that all numbers are divisible by it. If not possible print -1.
Examples:
Input : arr = {25, 20, 5, 10, 100}
Output : 5
Explanation : 5 is an array element
which divides all numbers.
Input : arr = {9, 3, 6, 2, 15}
Output : -1
Explanation : No numbers are divisible
by any array element.
Similar questions
Math,
15 days ago
Math,
15 days ago
Math,
1 month ago
Environmental Sciences,
1 month ago
English,
9 months ago
Social Sciences,
9 months ago
Sociology,
9 months ago