How can i write a code in c# to take a number from the user
and then find all the prime numbers till the number entered
by the user.
Answer Posted / guest
for(i=0;i<n;i++)
{
if(i==1||i==2||i==3||i==5||i==7)
{
printf("No is prime");
}
else if(i%2==0&&i%3==0&&i%5==0&&i%7==0)
{
printf("No is prime");
}
else
printf("No is not prime");
}
| Is This Answer Correct ? | 5 Yes | 9 No |
Post New Answer View All Answers
program for insertion ,deletion,sorting in double link list
What is coupling in oops?
i got a backdoor offer in process global,Bangalore..Can i work with it?
what are the realtime excercises in C++?
What is overriding vs overloading?
What is the difference between encapsulation and polymorphism?
what is different between oops and c++
write a program to enter a string like"sunil is a good boy and seeking for a job" not more than 10 characters including space in one line,rest characters should b in other line.if the next line starts from in between the previous word,then print whole word to next line.
What are the two different types of polymorphism?
Can you explain polymorphism?
What is pure oop?
What language is oop?
What is encapsulation c#?
What is the significance of classes in oop?
What is encapsulation oop?