Write a program to print the prime numbers from 1 to 100?

Answer Posted / deva

int main()
{
int i,j,count=0;

for(i=2;i<100;i++)
{

for( j=2;j<i;j++)
{
if(i%j==0)
count++;

}
if (count==0)
printf("%d\t",i);
count=0;
}

}

Is This Answer Correct ?    22 Yes 37 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What happens if you free a pointer twice?

604


What is a stream water?

652


What is a global variable in c?

587


Do array subscripts always start with zero?

776


write a programming in c to find the sum of all elements in an array through function.

1701






How many types of operator or there in c?

597


What are the types of variables in c?

578


Explain how can I convert a string to a number?

643


What type of function is main ()?

581


What does %d do?

711


What is dynamic memory allocation?

802


Can the curly brackets { } be used to enclose a single line of code?

709


Compare array data type to pointer data type

596


Why c is procedure oriented?

565


c language interview questions & answer

1455