write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / nachiyappan
#include<stdio.h>
#include<conio.h>
void main()
{
int i,j,c,n=1;
clrscr();
for(i=1;i<=100;i++)
{
n=n+1;
c=0;
for(j=1;j<=n;j++)
{
if(n%j==0)
c=c+1;
}
if(c==2)
printf("no. %d is prime",n);
else
printf("no. %d is not prime",n);
}
getch();
}
Is This Answer Correct ? | 33 Yes | 11 No |
Post New Answer View All Answers
What is the function of this pointer?
write a c program to find the sum of five entered numbers using an array named number
What are pointers? What are stacks and queues?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
What is realloc in c?
When should the volatile modifier be used?
With the help of using classes, write a program to add two numbers.
Explain what is wrong with this program statement?
Is there a way to switch on strings?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
What does s c mean in text?
How can I find out how much free space is available on disk?
Can we replace the struct function in tree syntax with a union?
What is a dynamic array in c?
What is a void pointer? When is a void pointer used?