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
Why dont c comments nest?
What is the meaning of typedef struct in c?
What is character set?
What is bash c?
What is a memory leak? How to avoid it?
Explain which function in c can be used to append a string to another string?
How can type-insensitive macros be created?
code for replace tabs with equivalent number of blanks
write a program to find the given number is prime or not
how is the examination pattern?
What is #include cctype?
How can you tell whether a program was compiled using c versus c++?
What is c definition?
What is the sizeof () operator?
Why main function is special give two reasons?