answersLogoWhite

0

/*Determine prime numbers between 1 to 50*/

#include<stdio.h>

#include<conio.h>

main()

{

int num, i ,n;

clrscr();

printf ( "\nEnter a number limit" ) ;

scanf ( "%d", &n ) ;

for ( num=2; num <= 50; num++ )

{

for ( i=2; i <= num - 1; i++ )

{

if ( num % i == 0 )

{

Break;

continue;

}

}

if (num==i)

printf(\n The Prime number=%d", num);

continue;

}

getch()

}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

Shell program to generate the prime numbers betwee 1 to 50?

2,3,5,7,9,11,13,17,19,23,29,31,37,39,41,43,47,49


What is a C program to generate prime no?

not sure of the exact syntax but its quite hard to generate them, but you can go through a list of numbers, that could be 0-10000000 say, and check if it is prime by dividing it by all the numbers that are smaller than it


Shell program to generate prime number between 1 and 50?

There are several shell programs available for download on the Internet that will generate prime numbers. The best way to find a prime number is through calculation, however.


How do you write a C plus plus program that will display the first 10 positive prime numbers?

By learning how to program on C+.


Which relies on prime numbers to generate keys?

Data encryption.


What is the formula of finding prime numbers from 500-0?

There is no formula that will generate all the prime numbers less than or equal to 500. Perhaps the "next best thing" is that there are some formulas that will generate prime numbers for certain values that are plugged in to the formula, but not necessarily all the prime numbers. For example, the formula n2 - n + 41 will generate prime numbers for all values of n from 0 to 40, but not for all values greater than or equal to 41. But even for values of n that are less than or equal to 40, while the formula will result in a prime number, it doesn't generate all the prime numbers. The first few prime numbers generated by this formula (for n = 0, 1, 2, 3, 4, and 5) are 41, 41, 43, 47, 53, and 61. But many prime numbers get "skipped over" by using this, or any other, formula.


What are two prime numbers that would generate 400?

There are no two prime numbers that would generate 400. The prime factorization of 400 is 2^4 * 5^2, which means it can be expressed as the product of two powers of primes, but not as the product of two distinct prime numbers.


Print first ten prime numbers in c?

// simple program to generate first ten prime numbers #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int c,i,j,n; clrscr(); for(i=2;i&lt;30;i++) { c=0; for(j=2;j&lt;i;j++) { if(i%j==0) {c=c+1; } } if(c==0) printf("%d",i); } getch(); }


How do you write a VBnet program to find the prime numbers between 100 to 200?

VBnet program to find the prime numbers between 100 to 200?


Write a program to print first 100 alternative prime numbers?

This would require some computer knowledge. It can make it easier to find out the prime numbers without figuring it out in your head.


With a given big integer number which is the product of two prime numbers how do you find them?

First write a program to generate the prime number. After one prime number was generated, divide the big int number by the prime number. If the remainder is zero then quotient is the second prime number ( also it is important to check whether the quotient is prime number or not because sometimes you will get wrong answer). Repeat the process until you get the result.


What are the first three prime numbers?

The first three prime numbers are 2,3 and 5.