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
How do you override a defined macro?
Is there any data type in c with variable size?
What is assert and when would I use it?
What is string constants?
What is identifier in c?
what value is returned to operating system after program execution?
Is boolean a datatype in c?
Explain data types & how many data types supported by c?
How to find a missed value, if you want to store 100 values in a 99 sized array?
What does malloc () calloc () realloc () free () do?
Explain the properties of union.
Write a program to reverse a linked list in c.
What are the different types of data structures in c?
What is the total generic pointer type?
How can I write functions that take a variable number of arguments?