write the program for prime numbers?
Answer Posted / sikendar kumar
#include<stdio.h>
#include<conio.h>
main()
{
int i,n,count=0;
clrscr();
printf("enter a no.");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
if(n%i==0)
{
count++;
}
}
if(count==1)
{
printf("not prime no.");
}
else
printf("prime");
return 0;
}
| Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
When should a far pointer be used?
What is action and transformation in spark?
Explain b+ tree?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
"C" language developed by "Dennis Ritchie" at AT & T. his remarks are a) too general, too abstract b) could deal with only specific problems c) lost generality of BCPL and B restored d) no remarks
How can you invoke another program from within a C program?
Explain how do you determine the length of a string value that was stored in a variable?
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
What does %2f mean in c?
Hai what is the different types of versions and their differences
Why is extern used in c?
how to make a scientific calculater ?
What is difference between array and structure in c?
write a c programming using command line argument,demonstrate set operation(eg;union,intersection,difference) example output is c:>setop 12 34 45 1 union 34 42 66 c:>setop 12 34 1 42 66 c:>setop 12 34 diff 12 56 67 78 setop 12 34
Explain enumerated types in c language?