Answer Posted / indu
#include<stdio.h>
#include<conio.h>
main()
{
int n,s=0,i;
clrscr();
printf("Enter the number\n");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
s++;
}
if(s>=1)
printf("%d is not prime",n);
else
printf("%d is prime",n);
getch();
}
ill execute it .it's cent percent correct.
Is This Answer Correct ? | 40 Yes | 22 No |
Post New Answer View All Answers
What is the difference between function overloading and operator overloading?
Why is c++ is better than c?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
What is a buffer c++?
Can constructor be private in c++?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?
Which programming language is best?
Explain how a pointer to function can be declared in C++?
Write about the role of c++ in the tradeoff of safety vs. Usability?
What is the use of cmath in c++?
What is the basic concept of c++?
What are the stages in the development cycle?
Describe delete operator?
What is virtual base class?
write a programme to get a character and thier ASCII value