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
Does improper inheritance have a potential to wreck a project?
How can we check whether the contents of two structure variables are same or not?
how to connect with oracle 9i with server in socket program in c/c++
Do class declarations end with a semicolon? Do class method definitions?
What are containers in c++?
Explain the difference between struct and class in terms of access modifier.
What is the history of c++?
How does code-bloating occur in c++?
Do class method definitions?
What are formatting flags in ios class?
Explain what is class definition in c++ ?
Does c++ support exception handling?
Explain how to initialize a const data member.
Describe the setting up of my member functions to avoid overriding by the derived class?
What is the main purpose of c++?