write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / prasad avunoori
int s=0;
int c,k;
for (int i = 2; i < 100; i++)
{
c = 0;
for (int j = 1; j <= i; j++)
{
if(i%j==0)
{
c = c + 1;
}
}
if (c == 2)
{
printf("%d\n",i);
s++;
}
} printf("There are %d " ,s);
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
What is the scope of static variable in c?
How can you increase the allowable number of simultaneously open files?
Explain how can you be sure that a program follows the ansi c standard?
How can I open a file so that other programs can update it at the same time?
How is = symbol different from == symbol in c programming?
Why do we use pointer to pointer in c?
Differentiate call by value and call by reference?
How will you print TATA alone from TATA POWER using string copy and concate commands in C?
What is n in c?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
Write a progarm to find the length of string using switch case?
Between macros and functions,which is better to use and why?
What is the purpose of clrscr () printf () and getch ()?
What does double pointer mean in c?
Write a program to check whether a number is prime or not using c?