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
How much maximum can you allocate in a single call to malloc()?
Why do we use iterators?
What are associate containers?
Explain differences between alloc() and free()?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?
What is a local reference?
Can we define function inside main in c++?
What is data types c++?
How static variables and local variablesare similar and dissimilar?
What is ifstream c++?
Why ctype h is used in c++?
What is the difference between global variables and static varables?
Who invented turbo c++?
You run a shell on unix system. How would you tell which shell are you running?
Which function cannot be overloaded c++?