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
Is null always defined as 0(zero)?
Explain how do you print an address?
What is operator precedence?
What is a macro?
What is the difference between the expression “++a” and “a++”?
explain how do you use macro?
What are structures and unions? State differencves between them.
What are the types of type qualifiers in c?
Write a program with dynamically allocation of variable.
What is boolean in c?
What is dynamic dispatch in c++?
What is the function of volatile in c language?
What is the meaning of typedef struct in c?
Write a program to print "hello world" without using a semicolon?
What are the ways to a null pointer can use in c programming language?