Answer Posted / rama
#include<stdio.h>
main()
{
int n,i,r;
clrscr();
printf("Enter the positive integer value");
scanf("%d",&n)
i=2;
step1:
if(i<=sqrt(n))
{
r=n%i;
if(r==0)
{
printf("%d is not a prime",n);
goto end;
}
}
else
{
i++;
goto step1;
}
printf("%d is prime number",n);
end:
printf(" ");
}
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is malloc in c++?
What is the best c++ ide?
What is a c++ map?
What are the advantages of using friend classes?
Is eclipse good for c++?
Explain polymorphism?
What is the importance of mutable keyword?
Which bit wise operator is suitable for turning off a particular bit in a number?
If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first a) 1 b) 5 c) 3
What are the benefits of oop in c++?
Write a function to find the nth item from the end of a linked list in a single pass.
Which recursive sorting technique always makes recursive calls to sort subarrays that are about half size of the original array?
Can we use pointers in c++?
What is the two main roles of operating system?
Why Pointers are not used in C++?