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 TO SOLVE A NUMERICAL OF LRU IN OS ??????
What is c mainly used for?
Differentiate between ordinary variable and pointer in c.
What is far pointer in c?
Why isn't any of this standardized in c? Any real program has to do some of these things.
What are different types of operators?
Place the #include statement must be written in the program?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
Explain how do you sort filenames in a directory?
how to write a c program to print list of fruits in alpabetical order?
What do mean by network ?
Which header file is essential for using strcmp function?
Explain what is a pragma?
What are the different data types in C?
Are local variables initialized to zero by default in c?