write the program for prime numbers?
Answer Posted / gnanasekaran
int main()
{
int i,j,n,f=0;
printf("Enter the length\n");
scanf("%d",&n);
for(i=2;i<=n/2;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 ? | 139 Yes | 81 No |
Post New Answer View All Answers
What is c programing language?
Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)
What do you mean by a sequential access file?
What is cohesion in c?
What is the difference between fread buffer() and fwrite buffer()?
Write a code on reverse string and its complexity.
What is the code for 3 questions and answer check in VisualBasic.Net?
What is the difference between far and near in c?
When is the “void” keyword used in a function?
What is the size of array float a(10)?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
What is meant by operator precedence?
Which built-in library function can be used to match a patter from the string?