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


Please Help Members By Posting Answers For Below Questions

What is the meaning of c in c language?

615


Explain the process of converting a Tree into a Binary Tree.

2125


How do I determine whether a character is numeric, alphabetic, and so on?

638


What is the use of sizeof () in c?

577


Explain what is the concatenation operator?

640






What is difference between structure and union with example?

610


c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above

631


Can you return null in c?

609


Write a program to reverse a given number in c language?

633


How many types of functions are there in c?

597


Which is the memory area not included in C program? give the reason

1520


Explain what is a const pointer?

649


What will be the outcome of the following conditional statement if the value of variable s is 10?

786


What are the 3 types of structures?

583


Explain high-order and low-order bytes.

684