C Program to identify the composite number in array - With Output

#include<conio.h>
#include<stdio.h>

void main()
{
int a[10],i,j,n;
printf(“Enter the size of array\t”);
scanf(“%d”,&n);
printf(“Enter the elements of the array\t”);
for(i=0;i<h;++i)
{
for(j=2;j<=a[i]/2;++j)
{
if(a[i]%j==0)
{
printf(“%d is not prime \n”,a[i]);
break;
}
}
}

getch();
}

OUTPUT :
Enter the size of array 10
Enter the element of array
1
2
3
4
5
6
7
8
9
                1
                4
                6
                8
                9

                is not prime
Share on Google Plus

About Akash Manhas

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment