Write a program to print the prime numbers from 1 to 100?
Answer Posted / aravind
#include<stdio.h?
int main()
{
int i,count=0;
for(i=1;i<=100;i++)
{
a=i%10;
if(a==0)
{
count++;
if(count<=2)
printf("the prime numbers are %d",i);
}
else
count=count;
}
the above answer is good but it will not print 1 as prime.
| Is This Answer Correct ? | 14 Yes | 23 No |
Post New Answer View All Answers
Explain low-order bytes.
How to draw the flowchart for structure programs?
What is nested structure with example?
How do you use a 'Local Block'?
What will the preprocessor do for a program?
explain how do you use macro?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is the meaning of c in c language?
A float occupies 4 bytes in memory. How many bits are used to store exponent part? since we can have up to 38 number for exponent so 2 ki power 6 6, 6 bits will be used. If 6 bits are used why do not we have up to 64 numbers in exponent?
What is maximum size of array in c?
What is graph in c?
Difference between Shallow copy and Deep copy?
What is quick sort in c?
What is the behavioral difference when include header file in double quotes (“”) and angular braces (<>)?
Is there sort function in c?