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 associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What is the value of uninitialized variable in c?
Is c is a high level language?
What is the use of clrscr?
What is array within structure?
What is openmp in c?
Explain setjmp()?
What are the advantage of c language?
How #define works?
What is NULL pointer?
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
How the c program is executed?
Difference between constant pointer and pointer to a constant.
What is function prototype in c language?
What is the use of define in c?