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
Does c++ have arraylist?
What is difference between n and endl in c++?
Describe Trees using C++ with an example.
What are the various oops concepts in c++?
What is the difference between object-oriented programming and procedural programming?
How much do c++ programmers make?
Write a program for Divide a number with 2 and Print the output ( NOTE: Check for divide by zero error).
What do nonglobal variables default to a) auto b) register c) static
Define upcasting.
Is c++ slower than c?
Name the operators that cannot be overloaded in C++?
Can we overload operator in c++?
Explain the use of virtual destructor?
Do vectors start at 0?
What is a string example?