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
Explain how a pointer to function can be declared in C++?
Give 10 points of differences between C & C++.
What is the difference between prefix and postfix versions of operator++()?
What are the benefits of oop in c++?
Is c++ high level programming language?
What is the use of this pointer in c++?
Write a program to find the Fibonacci series recursively.
Explain shallow copy?
Will rust take over c++?
What are the classes in c++?
what are Access specifiers in C++ class? What are the types?
What are the uses of static class data?
When should I use unitbuf flag?
Tell me difference between constant pointer and pointer to a constant.
Give the difference between the type casting and automatic type conversion. Also tell a suitable C++ code to illustrate both.