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

12y 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 of 11 using exponents?

11 is a prime number.


What is the prime factorization using exponents of 41?

41 is a prime number.


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.


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

To write a C program to find prime numbers between 1 to 500, you can use a nested loop structure. In the outer loop, iterate from 2 to 500, and in the inner loop, check if the number is divisible by any number from 2 to the square root of the number. If it is not divisible by any number other than 1 and itself, then it is a prime number. Print out all prime numbers found within the specified range. Remember to include necessary header files, such as &lt;stdio.h&gt;, and use appropriate logic to implement the program efficiently.


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.