write a Program to dispaly upto 100 prime numbers(without
using Arrays,Pointer)
Answer Posted / abhay
#include<stdio.h>
#include<conio.h>
void main()
{
int flag,x;
clrscr();
printf("1\t");
for(int i=1;i<=100;i++)
{
flag=0;
for(x=2;x<=i;x++)
{
if(i%x==0)
{
flag=1;
break;
}
else
continue;
}
if(i==x)
printf("%d\t",i);
}
getch();
}
| Is This Answer Correct ? | 291 Yes | 108 No |
Post New Answer View All Answers
What is difference between array and pointer in c?
Describe dynamic data structure in c programming language?
What is an identifier?
Is there a way to switch on strings?
what type of questions arrive in interview over c programming?
Difference between linking and loading?
What is calloc malloc realloc in c?
What is the difference between local variable and global variable in c?
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.
Difference between strcpy() and memcpy() function?
What is meant by 'bit masking'?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
using for loop sum 2 number of any 4 digit number in c language
what is different between auto and local static? why should we use local static?
Do you know the use of fflush() function?