write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)

Answer Posted / santhi perumal

#include<Stdio.h>
#include<conio.h>

int main()
{
int i,j, flag = 0;

for(i=2;i<=100;i++)
{
for(j=2;j<i;j++)
{
if(i != j)
{
if(i%j != 0)
continue;
else
break;
}
}
if(i == j)
printf("%d ",i);

}
}

Is This Answer Correct ?    52 Yes 38 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate abs() function from fabs() function.

598


write a program for the normal snake games find in most of the mobiles.

1787


What is the purpose of type declarations?

682


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

2107


How can I run c program?

691






How to delete a node from linked list w/o using collectons?

2090


Can we declare variable anywhere in c?

538


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

586


What is the difference between union and anonymous union?

836


List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.

2304


What is the size of a union variable?

603


Write the control statements in C language

651


Explain void pointer?

593


How do you define structure?

568


how to print the character with maximum occurence and print that number of occurence too in a string given ?

2037