in Education by
write a program to store 1st 25 prime number in an erray and display it Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Explanation: #include int main() { int a[10],n,i,j,c=0,prime[10],t=0; printf(“/*How Many Numbers You Want\nTo Add in Array*/\n\nEnter Limit : “); scanf(“%d”,&n); printf(“\nEnter %d Numbers in Array:\n\n”,n); for(i=0;i<n;i++) scanf(“%d”,&a[i]); for(i=0;i<n;i++) { c=0; for(j=2;j<a[i];j++) { if(a[i]%j==0) { c=1; break; } } if(c==0) { prime[t]=a[i]; t++; } } printf(“\nPrime Numbers in Above Array:\n\n”); for(i=0;i<t;i++) { printf(” %d “,prime[i]); } return 0; }

Related questions

0 votes
    write a program to store 1st 25 prime number in an erray and display it Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    write a program to store 1st 25 prime number in an erray and display it Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    Write a program to generate first 20 terms of Fibonacci series and store them in single dimension array. Display ... from the array Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to store the marks of any 5 subjects in different variables. Calculate total and average. ... ANY INPUT METHOD Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to find the area and perimeter of a square and rectangle. Store side in s , length as ... USE ANY INPUT METHOD Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to find the area and perimeter of a square and rectangle. Store side in s , length ... results in separate lines. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to store the marks of any 5 subjects in different variables. Calculate total and average. ... total and average. Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    write a program to input a number. check and display whether it is divisible by 100 Select the correct answer from above options...
asked Dec 17, 2021 in Education by JackTerrance
0 votes
    write a program to create a series object that store the table of number 5 Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    write a program to input a number and display the odd digits Select the correct answer from above options...
asked Dec 16, 2021 in Education by JackTerrance
0 votes
    write a program in java to accept a number and display the new number after removing all the zeros Select the correct answer from above options...
asked Dec 10, 2021 in Education by JackTerrance
0 votes
    write a program to display and find the sum of any ten natural number. Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    write a program to display and find the sum of any ten natural number. Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    Write a JAVA program to store the temperature in Celsius and convert it into Fahrenheit using the following formula ... INPUT METHOD Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    Write a program in java to display the given pattern. 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 Please ... as brainlist Please answer it very fast Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
...