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
How does #define work?
What is %lu in c?
Hai sir, I had planned to write the NIC scientific engineer exam , plz post the sample question......
Is linux written in c?
a parameter passed between a calling program and a called program a) variable b) constant c) argument d) all of the above
What is the use of volatile?
develop algorithms to add polynomials (i) in one variable
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
When can you use a pointer with a function?
What is f'n in math?
What would happen to X in this expression: X += 15; (assuming the value of X is 5)
In C programming, how do you insert quote characters (‘ and “) into the output screen?
Why are all header files not declared in every c program?
What do you mean by dynamic memory allocation in c?
Explain what header files do I need in order to define the standard library functions I use?