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
Give example of a pure virtual function in c++?
What do you mean by late binding?
Is c# written in c++?
What is an orthogonal base class in c++?
Can we specify variable field width in a scanf() format string? If possible how?
What is an inclusion guard?
Differentiate between the message and method in c++?
Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened
Is ca high or low level language?
Can we use pointers in c++?
You want to link a c++ program to c functions. How would you do it?
When should I use unitbuf flag?
How const int *ourpointer differs from int const *ourpointer?
What is the use of endl in c++?
How many namespaces are there in c++?