write the program for prime numbers?
Answer Posted / farhana parvin sunny
#include<stdio.h>
int main()
{
int i,j,n,f=0;
printf("Enter the length\n");
scanf("%d",&n);
for(i=2;i<=n;i++)
{
for(j=2;j<i;j++)
{
if((i%j)==0)
{
f=1;
break;
}
f=0;
}
if(f==0)
printf("%d ",i);
}
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
In C, What is the #line used for?
What does s c mean on snapchat?
What is pointers in c with example?
What is actual argument?
Explain how can I convert a number to a string?
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
What is memcpy() function?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
What is the significance of c program algorithms?
Explain what are binary trees?
What is omp_num_threads?
Difference between MAC vs. IP Addressing
How can you restore a redirected standard stream?
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the maximum number of concurrent threads that the InnoDB plug-in can create.
code for replace tabs with equivalent number of blanks