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
How a new element can be added or pushed in a stack?
When do we use copy constructors?
What is object file? How can you access object file?
What is enum c++?
Is c++ proprietary?
Which is most difficult programming language?
Mention the ways in which parameterized can be invoked.
What is the difference between delegation and implemented-in-terms-of?
What is the c++ code?
Can you write a function similar to printf()?
Why is the function main() special?
What do you mean by global variables?
Mention the ways in which parameterized can be invoked. Give an example of each.
Is c++ a float?
Out of fgets() and gets() which function is safe to use?