Computer Science, asked by kkeerthu943, 1 month ago

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 kushwaneha
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 khushichhatre1310
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