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
What is the benefit of using an enum rather than a #define constant?
What is substring in c?
Is c still relevant?
Write a code to generate a series where the next element is the sum of last k terms.
Can a variable be both const and volatile?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
How can I read and write comma-delimited text?
What does c value mean?
Function calling procedures? and their differences? Why should one go for Call by Reference?
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
How do you convert strings to numbers in C?
Explain what math functions are available for integers? For floating point?
Explain bit masking in c?
List out few of the applications that make use of Multilinked Structures?
What is scanf () in c?