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 full form of stl in c++?
Write a C++ Program to check whether a number is prime number or not?
In which situation the program terminates before reaching the breakpoint set by the user at the beginning of the mainq method?
Explain what data encapsulation is in c++?
What is runtime polymorphism in c++?
Difference between delete and free.
What is the best c++ compiler?
What is the difference between delegation and implemented-in-terms-of?
Is c++ platform dependent?
Which software is used for c++ programming?
What is the difference between the functions rand(), random(), srand() and randomize()?
What are the types of pointer?
How will you call C functions from C ++ and vice-versa?
Why do we use setw in c++?
What is a Default constructor?