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 are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
Is multimap sorted c++?
What is setbase c++?
What is the purpose of templates in c++?
What do you mean by funtion prototype?
Does there exist any other function which can be used to convert an integer or a float to a string?
Why do we learn c++?
Does c++ vector allocate memory?
Can constructor be static in c++?
What is scope operator in c++?
What is the difference between containment and delegation?
What is unary operator? List out the different operators involved in the unary operator.
What is difference between n and endl in c++?
State the difference between pre and post increment/decrement operations.
what are the events occur in intr activated on interrupt vector table