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
Why is c++ awesome?
What is data structure in c++?
Why do we need runtime polymorphism in c++?
What does it mean to declare a member variable as static?
what are the events occur in intr activated on interrupt vector table
What are special characters c++?
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?
Can we inherit constructor in c++?
What are the different types of polymorphism in c++?
What is the C-style character string?
What are disadvantages of pointers?
What is the hardest coding language to learn?
What is a c++ object?
Is c++ an oop?
What does the following do: for(;;) ; a) Illegal b) Loops forever c) Ignored by compiler...not illegal