A C program to print array of prime numbers;
#include <stdio.h>
int main()
{
int n;
int arr[100];
printf("Enter the value of n: ");
scanf("%d",&n);
for(int i=1; i<=n; i++)
{
if(i%2==0)
{
for(int j=0;j=i;j++)
{
arr[j]=i;
printf("Array: %d \n",arr[j]);
break;
}
}
}
return 0;
}
#include <stdio.h>
int main()
{
int n;
int arr[100];
printf("Enter the value of n: ");
scanf("%d",&n);
for(int i=1; i<=n; i++)
{
if(i%2==0)
{
for(int j=0;j=i;j++)
{
arr[j]=i;
printf("Array: %d \n",arr[j]);
break;
}
}
}
return 0;
}
No comments:
Post a Comment