write the program for prime numbers?
Answer Posted / biswa
void main()
{
int i=2;
int count=0;
int n;
printf("enter a no");
scanf("%d",&n);
for(i=2;i<n/2;i++)
{
if(n%i==0)
{
count++;
}
if(count>1)
{
prinf("prime");
else
printf("not prime");
}
| Is This Answer Correct ? | 311 Yes | 310 No |
Post New Answer View All Answers
What is meant by high-order and low-order bytes?
What are the header files used in c language?
Is javascript based on c?
general for is %wd,f-d; in this system "w" means a) 'w' represent total width of digits b) 'w' represent width which includes the digits before,after decimal place and the decimal point c) 'w' represent width which includes the digits before only d) 'w' represent width after decimal place only
What are the types of pointers in c?
How can a program be made to print the line number where an error occurs?
What does it mean when a pointer is used in an if statement?
Are enumerations really portable?
What is a header file?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
Explain the bubble sort algorithm.
What are type modifiers in c?
Differentiate Source Codes from Object Codes
swap 2 numbers without using third variable?
a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion