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
What is the significance of classes in oop?
What is stream in oop?
to find out the minimum of two integer number of two different classes using friend function
What is overloading in oops?
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.
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?
i=20;k=0;
for(j=1;k-i;k+=j<10?4:3)
{
cout< What language is oop? Write a program to compute for numeric grades for a course.
The course records are in a file that will serve as the
input file. The input file is in exactly the following
format: Each line contains a student's first name, then one
space, then ten quiz scores all on one line. The quiz scores
are in whole number and are separated by one space. Your
program will take it input from this file and sends it
output to a second file. The data in the output file will be
exactly the same as the data in the input file except that
there will be one additional number (of type double) at the
end of each line. This number will be the average of the
student's ten quiz scores. Use at least one function that
has file streams as all or some of its arguments. Can private class be inherited? What is abstraction with example? What is polymorphism used for? why reinterpret cast is considered dangerous? What is difference between abstraction and encapsulation? #include