Write a program to print the prime numbers from 1 to 100?
Answer Posted / dash
#include<stdio.h>
#include<conio.h>
void main()
{
int number,i;
clrscr();
for(i=1;i<=100;i++)
{
if(i%2==0)
{
printf("\n\n not prime number\t%d",i);
}
else
printf("\n\n prime number\t%d",i);
}
getch();
}
| Is This Answer Correct ? | 31 Yes | 86 No |
Post New Answer View All Answers
Can you pass an entire structure to functions?
What is null in c?
How can type-insensitive macros be created?
What is the purpose of macro in C language?
Define Spanning-Tree Protocol (STP)
What is the difference between far and near in c?
how to execute a program using if else condition and the output should enter number and the number is odd only...
What is the purpose of 'register' keyword?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
What is the use of header files?
What are structural members?
write a program to find out prime number using sieve case?
Why doesnt long int work?
Why doesnt that code work?
what type of questions arrive in interview over c programming?