answersLogoWhite

0

Print first ten prime numbers in c?

Updated: 10/17/2024
User Avatar

Wiki User

14y ago

Best Answer

// simple program to generate first ten prime numbers

#include<stdio.h>

#include<conio.h>

void main()

{

int c,i,j,n;

clrscr();

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

{

c=0;

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

{

if(i%j==0)

{c=c+1;

}

}

if(c==0)

printf("%d",i);

}

getch();

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Print first ten prime numbers in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the average of first ten prime numbers?

The average of the first ten prime numbers is 12.9.


Print sum of first ten even numbers?

It is 110.


What are the first 10 prime factors?

The first ten prime numbers are 2,3,5,7,11,13,17,19,23 and 29.


List the first ten prime numbers?

The first ten prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29 Hope it helps


How do you find the sum of the first ten prime numbers?

To find the sum of the first ten prime numbers, you first have to find what the first 10 prime numbers are. They are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. Added together they equal 129.


How would you find the first ten prime numbers?

To find the first ten prime numbers, you can start with the number 2 and then iteratively check if each subsequent number is divisible by any of the prime numbers found so far. If a number is not divisible by any prime numbers, it is considered a prime number. Continue this process until you have found the first ten prime numbers: 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29.


What of the first ten prime numbers are even number?

Two is the ONLY even prime number.


The product of first ten prime numbers must be divisible by?

22


What is the first ten prime numbers with a digit 1 in them?

The first ten prime numbers containing a digit 1 are: 11 13 17 19 31 41 61 71 101 103


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.


Are there Prime numbers between 100 and 150?

Yes. There are ten of them, the first is 101.


How do you do explain how you i found the first ten prime numbers?

You have to see if anything else multiples into it