Divisible program

 PROBLEM STATEMENT:

GET THE NO OF ELEMENTS AS àn

STORE THE ELEMENTS IN THE FORM OF ARRAYàa[10000]

DIVISORàd

#include<stdio.h>

#include<stdlib.h>

int main()

{

    int n,d,i,a[10000];

    scanf("%d",&n);

    for(i=0;i<n;i++)

    {

        scanf("%d",&a[i]);

    }

    scanf("%d",&d);

    for(i=0;i<n;i++)

    {

        if(a[i]%d==0)

        printf("%d ",a[i]);

    }

}

input:6                                //NO OF INPUTS                                                                                                                                     

10 20 30 40 50 60           //GET THE ELEMENTS IN THE ARRAY                                                                                                                  

4                                       //DIVISOR                                                                                                

output:20 40 60

 


Rajesh

This Blog will help you to find out the c programs solution easily and also you can able to understand the program.Please follow our blog for more useful updates.

Post a Comment (0)
Previous Post Next Post