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
Differentiate between the manipulator and setf( ) function?
What is c++ similar to?
What does std :: flush do?
What is c strings syntax?
What is the benefit of c++?
What is c++ 11 and c++ 14?
What is the correct syntax for inheritance a) class aclass : public superclass b) class aclass inherit superclass c) class aclass <-superclass
what are the events occur in intr activated on interrupt vector table
Are vectors faster than arrays?
What do you mean by public protected and private in c++?
Explain the differences between private, public and protected and give examples.
Where is atoi defined?
Explain how we implement exception handling in c++?
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
Can comments be longer than one line?