answersLogoWhite

0


Best Answer

I don't know C, but the process of finding a prime is the same in any programming language # Use a sequential list of numbers from two to some maximum. (10 in your case) # Delete all multiples of 2 greater than 2 from the list. # The next lowest, uncrossed off number in the list is a Prime number. # Delete all multiples of this number from the list. This can be started at the square of the number, as lower multiples have already been crossed out in previous steps. # Repeat steps 3 and 4 until you reach a number greater than the square root of the highest number in the list; all the numbers remaining in the list are prime

User Avatar

Wiki User

15y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include <stdio.h>

int main (void)

{

int i=o;n;

n=100;

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

{if(n%i!=0)

printf ("%d',i);}

}

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

#include<stdio.h>

int main (void) {

int x;

for (x=1; x<=10; ++x)

if (x==2 x==3 x==5 x==7)

printf ("%d is prime\n", x);

return 0

}

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Find the prime nofrom one to ten using 'for' or 'while' loop in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How to draw Flowchart to print prime numbers from 1 to 100 using while loop in c language?

c the book mastering c


Using phazon beam everywhere on Metroid prime?

The Phazon Beam can only be used while fight the Metroid Prime's 2nd form.


Why the command line is disordered while using GstarCAD?

Open the control panel of Windows in GstarCAD, select "Regional and language options" then select your required language.


What athlete uses bad language on the job?

There are many Athletes who have been found of using bad language while on the field. In football it is very common to use bad language due to rush of temper. Players like Luis Suarez and Wayne Rooney have been reported for using bad language.


What is a sentence using innuendo?

While Jane's speech was perfectly harmless, her body language was full of unprofessional innuendo.


What is the difference between language and thought?

Language refers to the system of communication using words, symbols, and grammar, while thought refers to the mental processes and ideas that occur within an individual's mind. While language enables us to express and communicate thoughts, thought can exist independent of language. In other words, language is the tool we use to express and convey our thoughts, while thought is the content of our mental processes.


Four basic instruction in C language?

They are 'statements' to speak strictly, they are: , , if, else, while, for, do, return, switch, break, continue, gotoNote: is zero or more statements between '{' and '}'


What is is the coding of finding any prime number in C language?

#include"stdio.h" #include"conio.h" main(){ int x,i=2; clrscr(); printf("\nEnter a no"); scanf("%d",&amp;x); while(i&lt;=x-1){ if(x%i==0) printf("\nNOT PRIME"); break; i++} if(i==x) printf("\nNo is prime"); getch(); }


Explanation of machine code or oriented language?

Machine Code is composed in terms of bits (0 and 1), while Object Oriented Language uses almost English language. Explanation: It is hard to memorize 0 and 1, while using words makes it more ideal for understanding. Are you sure you want to learn in 0 and 1.


Is it rude to use sign language while eating?

yes it is mean to eat while using sign language because u are still talking


Although Gwen's parents often were not happy with her use of foul language they were powerless to stop her from using it in front of them and their friends Why?

Because Gwen is a referee. Hence she uses language such as "foul!" while on the job, regardless of her audience.


What is it called when you stop using drugs for a while and you use again for one day?

In addiction communities, it is called a relapse. In everyday language, you made a mistake.