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
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
Why header files are used?
What are the two types of functions in c?
Explain how can you check to see whether a symbol is defined?
What are the advantage of c language?
What are the different data types in C?
Write a c program to build a heap method using Pointer to function and pointer to structure ?
What is putchar() function?
What is meant by realloc()?
Which is best linux os?
Is sizeof a keyword in c?
if p is a string contained in a string?
What is switch in c?
Where in memory are my variables stored?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream