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
difference between native and cross compilers
What is a char c?
write a c program for swapping two strings using pointer
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
How can you convert integers to binary or hexadecimal?
Explain is it better to bitshift a value than to multiply by 2?
Write a program to print ASCII code for a given digit.
How do we make a global variable accessible across files? Explain the extern keyword?
What does do in c?
What is array in c with example?
What the different types of arrays in c?
What are the disadvantages of c language?
What is an endless loop?
What is a dynamic array in c?
Explain indirection?