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
What is a stream?
What is a nested loop?
Describe the header file and its usage in c programming?
What is time complexity c?
What is #include stdlib h?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
What are the 4 data types?
Are c and c++ the same?
What is the difference between malloc() and calloc() function in c language?
How can you find the exact size of a data type in c?
What is an auto keyword in c?
Iam a B.Tech graduate and completed my engineering in 2009, from 2005 to 2009 and after that i had done nothing.Now i want to do job and get into BPO field . Friends give me suggestions as what to say in interview... if they ask me that what would you had done ... these many years without doing job ??????? pls urgent
How can you pass an array to a function by value?
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
What are conditional operators in C?