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
Do you know what is overriding?
What should main() return in c and c++?
Will a recursive function without an end condition every quit, in practice a) Compiler-Specific (Some can convert to an infinite loop) b) No c) Yes
Can a program run without main in c++?
what is C++ exceptional handling?
Are vectors passed by reference c++?
Difference between inline functions and macros?
What are the sizes and ranges of the basic c++ data types?
What's the "software peter principleā?
Explain the problem with overriding functions
Which is the best c++ compiler?
What do you mean by function and operator overloading in c++?
Difference between pointer to constant and constant pointer to a constant. Give example.
What is a c++ map?
What is a unnitialised pointer?