write the program for prime numbers?

Answer Posted / sujeet

#include<iostrream.h>
#include<conio.h>
void main()
{
int n;
cin>>n;
if(n==2)
{
cout<<"no is prime")
if(n%2!=0)
{
if(n%3!=0)
{
if(n%5!=0)
{
if(n%7!=if(n%2!=0)
{
0)
{
if(n%11!=0)
{
if(n%13!=0)
{
cout<<"no is prime ";
}
}
}
}
}
}
}
}
}
getch()
}

Is This Answer Correct ?    1 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are reserved words with a programming language?

602


What does typedef struct mean?

658


What is modeling?

647


How can a string be converted to a number?

517


What is string function c?

565






How do I round numbers?

599


Write a program that accept anumber in words

1250


Explain why can’t constant values be used to define an array’s initial size?

854


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1886


Is that possible to store 32768 in an int data type variable?

690


Why isn't it being handled properly?

645


Is stack a keyword in c?

635


What is the difference between #include and #include 'file' ?

604


How can you increase the allowable number of simultaneously open files?

595


What are loops in c?

549