Computers & Internet Logo

Related Topics:

Posted on May 20, 2009
Answered by a Fixya Expert

Trustworthy Expert Solutions

At Fixya.com, our trusted experts are meticulously vetted and possess extensive experience in their respective fields. Backed by a community of knowledgeable professionals, our platform ensures that the solutions provided are thoroughly researched and validated.

View Our Top Experts

C# code wite a program to accept a number from the user and display all the prime numbers fro zero up to the numbers entered by user?

Write a program to accept a number from the user and display all the prime numbers fro zero up to the numbers entered by user?

1 Answer

Anonymous

Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

Sniper:

An expert who has posted more than 50 answers, of which 90% or more were rated as helpful.

Governor:

An expert whose answer got voted for 20 times.

  • Expert 68 Answers
  • Posted on May 21, 2009
Anonymous
Expert
Level 2:

An expert who has achieved level 2 by getting 100 points

MVP:

An expert that got 5 achievements.

Sniper:

An expert who has posted more than 50 answers, of which 90% or more were rated as helpful.

Governor:

An expert whose answer got voted for 20 times.

Joined: Jan 13, 2009
Answers
68
Questions
0
Helped
62021
Points
205

#include<stdio.h>
#include<conio.h>
void main()
{
int n,i,rem,prime,primchk=1,chk;
clrscr();
printf("\nEnter the limit\n");
scanf("%d",&n);
printf("\n\n\nThe prime numbers are\n");
printf("\n2\t3\t");
for(primchk=1;primchk<=n;primchk++)
{
for(i=2;i<primchk;i++)
{
if(primchk%i==0)
{
chk=1;
chk=0;
break;
}
if(i==primchk-1)
{
if(chk==0)
{
printf("%d\t",primchk);
chk=0;
}
}
}
}
getch();
}

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

722 views

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

ADMIN Andrew
ADMIN Andrew

Level 3 Expert

73813 Answers

ADMIN Eric
ADMIN Eric

Level 3 Expert

42247 Answers

Brad Brown

Level 3 Expert

19190 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...