write the program for prime numbers?
Answer Posted / shubhanshu pandey
main()
{
int a,c=0,i,n;
printf("enter the number to be checked");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
a=n%i;
if(a=0)
{
c=c+1;
}
}
if (c=2)
{ printf("the given number is prime"); }
else
printf("the given number is not prime");
}
| Is This Answer Correct ? | 7 Yes | 4 No |
Post New Answer View All Answers
Can variables be declared anywhere in c?
List some of the dynamic data structures in C?
Explain what header files do I need in order to define the standard library functions I use?
What are called c variables?
Is c is a high level language?
Differentiate call by value and call by reference?
What is the difference between array and pointer in c?
What is the acronym for ansi?
Why is c fast?
Can you explain the four storage classes in C?
Is stack a keyword in c?
How can you return multiple values from a function?
What are the 5 elements of structure?
we called a function and passed something do it we have always passed the "values" of variables to the called function. such functions calles are called a) calls by reference b) calls by value c) calls by zero d) none of the above
Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?