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
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
i want to know the procedure of qualcomm for getting a job through offcampus
What are bitwise shift operators in c programming?
Write a program to generate random numbers in c?
The file stdio.h, what does it contain?
How can I read/write structures from/to data files?
How does struct work in c?
What is the difference between #include
What is c programming structure?
What does the c in ctime mean?
What is data structure in c programming?
What do you mean by dynamic memory allocation in c? What functions are used?
Is there any possibility to create customized header file with c programming language?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
is it possible to create your own header files?