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
Write A Program to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
What is the advantage of oop over procedural language?
What exactly is polymorphism?
What is encapsulation in ict?
What is abstraction and encapsulation?
What are the 3 pillars of oop?
can inline function declare in private part of class?
What is persistence in oop?
What is polymorphism in oop example?
Which is not an object oriented programming language?
when to use 'mutable' keyword and when to use 'const cast' in c++
What is encapsulation oop?
Why it is called runtime polymorphism?
What is class encapsulation?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).