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

Why do while loop is used?

801


write a program to find 2 power of a 5digit number with out using big int and exponent ?

2155


What is protected in oop?

827


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

2179


What is the real time example of encapsulation?

816


What are different types of JVM's? for example we use dalvik jvm for android then what about the remaining operating systems?

1924


What is polymorphism explain its types?

944


What is polymorphism in oop example?

771


Advantage and disadvantage of routing in telecom sector

1056


write a code for this. serial_number contained in the header of the file will be read , if this serial number is less than a previous serial number within a successfully processed file, or is the same as another serial number within a successfully processed file, or if the field contains anything other than 7 digits, then the file must error with the reason ‘Invalid SERIAL_NUMBER’.

2008


Can we define a class within the interface?

814


when to use 'mutable' keyword and when to use 'const cast' in c++

1909


is there any choice in opting subjects like 4 out of 7

1955


Prepare me a program for the animation of train

2238


What is destructor example?

793