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 is the benefit of using an enum rather than a #define constant?

665


What is substring in c?

643


Is c still relevant?

646


Write a code to generate a series where the next element is the sum of last k terms.

742


Can a variable be both const and volatile?

678






How can I check whether a file exists? I want to warn the user if a requested input file is missing.

658


How can I read and write comma-delimited text?

625


What does c value mean?

635


Function calling procedures? and their differences? Why should one go for Call by Reference?

639


the process of defining something in terms of itself is called (or) in C it is possible for the functions to call themselves. A function called a) nested function b) void function c) recursive function d) indifinite function

764


How do you convert strings to numbers in C?

713


Explain what math functions are available for integers? For floating point?

618


Explain bit masking in c?

642


List out few of the applications that make use of Multilinked Structures?

1310


What is scanf () in c?

666