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 / anjali

while(num>0)
{
if(num%2==1)
printf("num is prime value");
}

Is This Answer Correct ?    1 Yes 10 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.

929


How to improve object oriented design skills?

760


What is oops in simple words?

811


What is difference between pop and oop?

817


Why do we use oops?

762


What is oops concept with example?

768


Will I be able to get a picture in D drive to the c++ program? If so, help me out?

1879


What is the highest level of cohesion?

772


Can an interface inherit a class?

781


Can destructor be overloaded?

800


any one please tell me the purpose of operator overloading

2167


Why is polymorphism used?

779


What is the fundamental idea of oop?

860


what are the different types of qualifier in java?

2021


What are the features of oop?

836