answersLogoWhite

0

int main()

{

int i,j,n,f=0;

printf("Enter the length\n");

scanf("%d",&n);

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

{

for(j=2;j<i;j++)

{

if((i%j)==0)

{

f=1;

break;

}

f=0;

}

if(f==0)

printf("%d ",i);

}

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Is 5291 a prime number using 2 numbers?

No 5291 is not a prime using 2 numbers. It is a prime using three numbers.


A prime number between 10 and 20 one more than a square number?

17The prime numbers between 10 and 20 are 11, 13, 17 and 19. There is only one square number between 10 and 20: 16. Using the criteria given, the number that fits is 17.


Program for print prime all number from 1 to 100 in foxpro?

Oh, what a lovely request! In FoxPro, you can create a program to print all prime numbers from 1 to 100 by using a loop to check each number for divisibility only by 1 and itself. If it meets this criteria, you can print it out on the screen. Remember, every number is unique and special, just like a happy little tree in a vast forest.


How can you check whether a number is prime or not by a C program using functions?

#include&lt;iostream.h&gt; #include&lt;conio.h&gt; void prime(int n) { clrscr(); int num; cout&lt;&lt;"enter the numbers"&lt;&lt;endl; cin&gt;&gt;num; prime(num); getch(); } void prime(int n) { int prime=1,i; for(i=2;i&lt;=n/2;i++) if(n%i==1) prime=0; if(prime==1) cout&lt;&lt;"the number"&lt;&lt;n&gt;&gt;"is prime"; else cout&lt;&lt;"the number"&lt;&lt;n&lt;&lt;"is not prime"; }


What is the prime factorization of 47 using exponents?

47 is a prime number.


What is the prime factorization using exponents of 41?

41 is a prime number.


What is the prime factorization of 11 using exponents?

11 is a prime number.


Write a c program to find out the prime numbers between 1 to 500?

Here is a simple program to generate prime numbers upto a given specific number /*Prime No. from 1 to 50*/ /*By-Himanshu Rathee*/ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int i,j,n; clrscr(); printf(" Enter the number upto which we have to find the prime number: "); scanf("%d",&amp;n); printf("\n"); for(i=2;i&lt;=n;i++) { for(j=2;j&lt;=i-1;j++) if(i%j==0) break; /*Number is divisble by some other number. So break out*/ if(i==j) printf("\t%d",i); /*Number was divisible by itself (that is, i was same as j)*/ } /*Continue loop upto nth number*/ getch(); }


What is the prime factorization of 887 using exponents?

None. 887 is a prime number.


What is the prime factorization of 13 using exponents?

NA: 13 is a prime number.


What is the sum of the even numbers from 4 to 50 using only prime numbers?

The question is quite ambiguous. If you're talking about all the even prime numbers between 4 and 50, then the sum is zero. No even number, except '2', is a prime number, so there aren't any between 4 and 50..


Prime number using the exponent of 70?

No prime power exists since there are no duplicate prime numbers in the prime factorization.